{"id":3111,"date":"2025-07-28T08:44:58","date_gmt":"2025-07-28T07:44:58","guid":{"rendered":"https:\/\/workboot.fr\/ciela\/?page_id=3111"},"modified":"2025-11-24T15:29:39","modified_gmt":"2025-11-24T14:29:39","slug":"python3","status":"publish","type":"page","link":"https:\/\/workboot.fr\/ciela\/python3\/","title":{"rendered":"Python3"},"content":{"rendered":"\n<nav aria-label=\"Table des mati\u00e8res\" class=\"wp-block-table-of-contents\"><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#presentation-de-python\">Pr\u00e9sentation de Python<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#prerequis\">Pr\u00e9requis<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#installation\">Installation <\/a><\/li><\/ol><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#premiers-pas-avec-python\">Premiers Pas avec Python<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#lancer-l-interpreteur-python\">Lancer l&rsquo;interpr\u00e9teur Python<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#premieres-commandes\">Premi\u00e8res commandes<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#quitter-l-interpreteur\">Quitter l&rsquo;interpr\u00e9teur<\/a><\/li><\/ol><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#ecrire-un-premier-script\">\u00c9crire un Premier Script<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#creer-un-fichier-python\">Cr\u00e9er un fichier Python<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#executer-le-script\">Ex\u00e9cuter le script<\/a><\/li><\/ol><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#concepts-de-base\">Concepts de Base<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#typage-faible-vs-fort\">Typage Faible vs Fort<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#python-est-dynamiquement-type-mais-relativement-fort\">Python est dynamiquement typ\u00e9, mais relativement fort<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#variables-et-types\">Variables et Types<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#operations-de-base\">Op\u00e9rations de Base<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#3-structures-de-controle\">3. Structures de Contr\u00f4le<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#condition-if\">Condition if:<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#boucle-for\">Boucle for:<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#boucle-while\">Boucle while:<\/a><\/li><\/ol><\/li><\/ol><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#projet-pratique-devine-le-nombre\">Projet Pratique: Devine le Nombre<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#gestion-des-erreurs-avec-try-except-en-python\">Gestion des erreurs avec try\/except\u00a0en Python<\/a><\/li><\/ol><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#introduction-a-pdb-debugger-python\">Introduction \u00e0\u00a0pdb (debugger python)<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#demarrer-pdb\">D\u00e9marrer\u00a0pdb<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#methode-1-lancer-un-script-en-mode-debogage\">M\u00e9thode 1 : Lancer un script en mode d\u00e9bogage<\/a><\/li><\/ol><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#commandes-essentielles\">\u00a0Commandes Essentielles<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#gestion-des-breakpoints\">\u00a0Gestion des Breakpoints<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#inspection-des-variables\">\u00a0Inspection des Variables<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#navigation-dans-la-pile-d-appels\">Navigation dans la Pile d&rsquo;Appels<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#ipdb-encore-mieux-en-couleur\">ipdb encore mieux en couleur <\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#pourquoi-choisir-ipdb\">Pourquoi choisir ipdb ?<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/workboot.fr\/ciela\/python3\/#conclusion\">Conclusion<\/a><\/li><\/ol><\/nav>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"presentation-de-python\">Pr\u00e9sentation de Python<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Langage de programmation simple, puissant et populaire<\/li>\n\n\n\n<li>Utilis\u00e9 dans de nombreux domaines : web, science des donn\u00e9es, robotique (comme le Raspberry Pi!)<\/li>\n\n\n\n<li>Syntaxe claire et facile \u00e0 lire<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prerequis\">Pr\u00e9requis<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Pour ce cours, nous supposons que vous avez:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Un syst\u00e8me Linux (Ubuntu , Debian ou Raspberry Pi OS 64-bit)<\/li>\n\n\n\n<li>Python3 d\u00e9j\u00e0 install\u00e9 (v\u00e9rifiez avec&nbsp;<code>python3 --version<\/code>)<\/li>\n\n\n\n<li>Un \u00e9diteur de texte comme vi<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installation\">Installation <\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt install python3<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"premiers-pas-avec-python\">Premiers Pas avec Python<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"lancer-l-interpreteur-python\">Lancer l&rsquo;interpr\u00e9teur Python<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ouvrez un terminal et tapez:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u279c  ~ python --version\nPython 3.10.4\n\u279c  ~ <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">il faut une version 3 minimum (car 2 n&rsquo;est plus d&rsquo;actualit\u00e9e)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u279c  ~ python\nPython 3.10.4 (main, Jun 29 2022, 12:14:53) &#91;GCC 11.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n&gt;&gt;&gt; <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"premieres-commandes\">Premi\u00e8res commandes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Essayez ces op\u00e9rations simples:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>>>> print(\"Bonjour le monde!\")\n>>> 2 + 3\n>>> 10 \/ 2\n>>> nom = \"VotreNom\"\n>>> print(\"Je m'appelle\", nom)\nPython 3.11.2 (main, Apr 28 2025, 14:11:48) &#91;GCC 12.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> list(range(5))\n&#91;0, 1, 2, 3, 4]\n>>> list(\"bonjour\")\n&#91;'b', 'o', 'n', 'j', 'o', 'u', 'r']\n>>> \n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"quitter-l-interpreteur\">Quitter l&rsquo;interpr\u00e9teur<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; exit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">on appel la fonction exit pour en sortir<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">avec le <a href=\"https:\/\/workboot.fr\/ciela\/signaux-clavier-dans-le-terminal-linux\/\">clavier<\/a> <strong>ctrl d <\/strong>(^d)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ecrire-un-premier-script\">\u00c9crire un Premier Script<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"creer-un-fichier-python\">Cr\u00e9er un fichier Python<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ouvrez votre \u00e9diteur de texte et cr\u00e9ez un fichier&nbsp;<code>bonjour.py<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/usr\/bin\/env python3\n# Ceci est un commentaire\n\nprint(\"Bonjour les programmeurs en herbe!\")\nprenom = input(\"Comment t'appelles-tu? \")\nprint(\"Enchant\u00e9,\", prenom, \"!\")\n\nage = input(\"Quel \u00e2ge as-tu? \")\nprint(\"Dans 10 ans, tu auras\", int(age) + 10, \"ans!\")<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"executer-le-script\">Ex\u00e9cuter le script<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Dans le terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 bonjour.py   <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">ou, si bien param\u00e9tr\u00e9 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python bonjour.py<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Ou rendez-le ex\u00e9cutable:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">comme n&rsquo;importe quel script.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x bonjour.py\n.\/bonjour.py<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"concepts-de-base\">Concepts de Base<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"typage-faible-vs-fort\"><strong>Typage Faible vs Fort<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Faiblement typ\u00e9 (weakly typed)<\/strong>&nbsp;:<br>Le langage est permissif avec les conversions implicites entre types.<br>Exemple :&nbsp;<code>\"3\" + 4<\/code>&nbsp;pourrait donner&nbsp;<code>\"34\"<\/code>&nbsp;(JavaScript) ou&nbsp;<code>7<\/code>&nbsp;(selon le langage).<\/li>\n\n\n\n<li><strong>Fortement typ\u00e9 (strongly typed)<\/strong>&nbsp;:<br>Le langage impose des r\u00e8gles strictes sur les types et refuse les op\u00e9rations incoh\u00e9rentes.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"python-est-dynamiquement-type-mais-relativement-fort\"><strong>Python est dynamiquement typ\u00e9, mais relativement fort<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u2714 Dynamique<\/strong>&nbsp;: Pas besoin de d\u00e9clarer le type d&rsquo;une variable (<code>x = 10<\/code>&nbsp;suffit, pas besoin de&nbsp;<code>int x = 10<\/code>).<\/li>\n\n\n\n<li><strong>\u2714 Fort<\/strong>&nbsp;: Python ne fait&nbsp;<strong>pas de conversions implicites dangereuses<\/strong>&nbsp;comme certains langages faiblement typ\u00e9s, comme javascript !<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u2705 Op\u00e9rations autoris\u00e9es (mais logiques)\nprint(3 + 5.0)   # \u2192 8.0 (int + float \u2192 float)\nprint(\"abc\" + \"def\")  # \u2192 \"abcdef\" (concat\u00e9nation)\n\n# \u274c Op\u00e9rations interdites (Python l\u00e8ve une erreur)\nprint(\"10\" + 5)   # \u2192 TypeError (pas de conversion auto de str en int)\nprint(10 + \"5\")   # \u2192 M\u00eame erreur<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"variables-et-types\">Variables et Types<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Cha\u00eenes de caract\u00e8res (str)\nnom = \"Alice\"\nmessage = 'Bonjour'\n\n# Nombres entiers (int)\nage = 12\n\n# Nombres \u00e0 virgule (float)\ntaille = 1.65\n\n# Bool\u00e9ens (bool)\nest_eleve = True<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"operations-de-base\">Op\u00e9rations de Base<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Math\u00e9matiques\n5 + 3   # Addition\n7 - 2   # Soustraction\n6 * 4   # Multiplication\n8 \/ 2   # Division\n10 \/\/ 3 # Division enti\u00e8re\n10 % 3  # Modulo (reste)\n\n# Cha\u00eenes de caract\u00e8res\nprenom = \"Jean\"\nnom = \"Dupont\"\nnom_complet = prenom + \" \" + nom<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-structures-de-controle\">3. Structures de Contr\u00f4le<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"condition-if\"><strong>Condition if:<\/strong><\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">age = int(input(\"Quel \u00e2ge as-tu? \"))\n\nif age &lt; 13:\n    print(\"Tu es un enfant!\")\nelif age &lt; 18:\n    print(\"Tu es un adolescent!\")\nelse:\n    print(\"Tu es un adulte!\")<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"boucle-for\"><strong>Boucle for:<\/strong><\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">for i in range(5):  # 0 \u00e0 4\n    print(\"Num\u00e9ro\", i)\n\nfor lettre in \"Python\":\n    print(lettre)<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"boucle-while\"><strong>Boucle while:<\/strong><\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">compteur = 0\nwhile compteur &lt; 5:\n    print(\"Compteur:\", compteur)\n    compteur += 1<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"projet-pratique-devine-le-nombre\">Projet Pratique: Devine le Nombre<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Cr\u00e9ez un fichier&nbsp;<code>devine.py<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/usr\/bin\/env python3\nimport random\n\nnombre_secret = random.randint(1, 100)\nessais = 0\nmax_essais = 7\n\nprint(\"J'ai choisi un nombre entre 1 et 100. Devine lequel!\")\n\nwhile essais &lt; max_essais:\n    essais += 1\n    essai = int(input(\"Essai {}: \".format(essais)))\n    \n    if essai &lt; nombre_secret:\n        print(\"Trop petit!\")\n    elif essai > nombre_secret:\n        print(\"Trop grand!\")\n    else:\n        print(\"Bravo! Tu as trouv\u00e9 en\", essais, \"essais.\")\n        break\n\nif essais >= max_essais:\n    print(\"D\u00e9sol\u00e9, le nombre \u00e9tait\", nombre_secret)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"gestion-des-erreurs-avec-try-except-en-python\"><strong><code>Gestion des erreurs avec try\/except<\/code>&nbsp;en Python<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Le bloc&nbsp;<code>try\/except<\/code>&nbsp;est un m\u00e9canisme de&nbsp;<strong>gestion des erreurs<\/strong>&nbsp;qui permet d&rsquo;<strong>attraper<\/strong>&nbsp;et&nbsp;<strong>traiter<\/strong>&nbsp;les exceptions pour \u00e9viter que le programme ne plante.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Structure de Base<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">try:\n    # Code susceptible de provoquer une erreur\n    resultat = 10 \/ 0  # Division par z\u00e9ro \u2192 erreur\nexcept:\n    # Code ex\u00e9cut\u00e9 si une erreur survient\n    print(\"Une erreur est survenue !\")<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction-a-pdb-debugger-python\"><strong>Introduction \u00e0&nbsp;<code>pdb<\/code><\/strong> (debugger python)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>pdb<\/strong>&nbsp;(<em>Python Debugger<\/em>) est un outil int\u00e9gr\u00e9 \u00e0 Python pour d\u00e9boguer du code. Il permet :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>D\u2019ex\u00e9cuter le code&nbsp;<strong>ligne par ligne<\/strong><\/li>\n\n\n\n<li>D\u2019inspecter les&nbsp;<strong>variables<\/strong><\/li>\n\n\n\n<li>De poser des&nbsp;<strong>points d&rsquo;arr\u00eat<\/strong>&nbsp;(<em>breakpoints<\/em>)<\/li>\n\n\n\n<li>De&nbsp;<strong>corriger des bugs<\/strong>&nbsp;en temps r\u00e9el<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"demarrer-pdb\"><strong>D\u00e9marrer&nbsp;<code>pdb<\/code><\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"methode-1-lancer-un-script-en-mode-debogage\"><strong>M\u00e9thode 1 : Lancer un script en mode d\u00e9bogage<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 -m pdb mon_script.py<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Avantage<\/strong>&nbsp;: D\u00e9bogue d\u00e8s la premi\u00e8re ligne.<\/li>\n\n\n\n<li><strong>Inconv\u00e9nient<\/strong>&nbsp;: N\u00e9cessite de relancer le script apr\u00e8s chaque modification.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"commandes-essentielles\"><strong>&nbsp;Commandes Essentielles<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Commande<\/th><th class=\"has-text-align-left\" data-align=\"left\">Raccourci<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><strong><code>help<\/code><\/strong><\/td><td><code>h<\/code><\/td><td>Affiche l\u2019aide g\u00e9n\u00e9rale<\/td><\/tr><tr><td><strong><code>next<\/code><\/strong><\/td><td><code>n<\/code><\/td><td>Ex\u00e9cute la ligne actuelle et passe \u00e0 la suivante<\/td><\/tr><tr><td><strong><code>step<\/code><\/strong><\/td><td><code>s<\/code><\/td><td>Entre dans une fonction (si appel)<\/td><\/tr><tr><td><strong><code>continue<\/code><\/strong><\/td><td><code>c<\/code><\/td><td>Reprend l&rsquo;ex\u00e9cution jusqu&rsquo;au prochain breakpoint<\/td><\/tr><tr><td><strong><code>quit<\/code><\/strong><\/td><td><code>q<\/code><\/td><td>Quitte le d\u00e9bogueur brutalement<\/td><\/tr><tr><td><strong><code>list<\/code><\/strong><\/td><td><code>l<\/code><\/td><td>Affiche 10 lignes autour de la position actuelle<\/td><\/tr><tr><td><strong><code>print(var)<\/code><\/strong><\/td><td><code>p var<\/code><\/td><td>Affiche la valeur d\u2019une variable<\/td><\/tr><tr><td><strong><code>return<\/code><\/strong><\/td><td><code>r<\/code><\/td><td>Continue jusqu&rsquo;\u00e0 la fin de la fonction actuelle<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"gestion-des-breakpoints\"><strong>&nbsp;Gestion des Breakpoints<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Commande<\/th><th class=\"has-text-align-left\" data-align=\"left\">Exemple<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><strong><code>break &lt;ligne&gt;<\/code><\/strong><\/td><td><code>b 10<\/code><\/td><td>Pose un breakpoint \u00e0 la ligne 10<\/td><\/tr><tr><td><strong><code>break &lt;fichier&gt;:&lt;ligne&gt;<\/code><\/strong><\/td><td><code>b script.py:15<\/code><\/td><td>Breakpoint dans un fichier sp\u00e9cifique<\/td><\/tr><tr><td><strong><code>break &lt;fonction&gt;<\/code><\/strong><\/td><td><code>b ma_fonction<\/code><\/td><td>Breakpoint \u00e0 l\u2019entr\u00e9e d\u2019une fonction<\/td><\/tr><tr><td><strong><code>clear<\/code><\/strong><\/td><td><code>cl 2<\/code><\/td><td>Supprime le breakpoint n\u00b02<\/td><\/tr><tr><td><strong><code>disable<\/code><\/strong><\/td><td><code>disable 1<\/code><\/td><td>D\u00e9sactive temporairement un breakpoint<\/td><\/tr><tr><td><strong><code>enable<\/code><\/strong><\/td><td><code>enable 1<\/code><\/td><td>R\u00e9active un breakpoint<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"inspection-des-variables\"><strong>&nbsp;Inspection des Variables<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Commande<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><strong><code>p &lt;variable&gt;<\/code><\/strong><\/td><td>Affiche la valeur (<code>p x<\/code>)<\/td><\/tr><tr><td><strong><code>pp &lt;variable&gt;<\/code><\/strong><\/td><td>Pretty-print pour les structures complexes<\/td><\/tr><tr><td><strong><code>whatis &lt;variable&gt;<\/code><\/strong><\/td><td>Affiche le type (<code>whatis liste<\/code>)<\/td><\/tr><tr><td><strong><code>display &lt;variable&gt;<\/code><\/strong><\/td><td>Affiche la variable \u00e0 chaque \u00e9tape<\/td><\/tr><tr><td><strong><code>undisplay &lt;id&gt;<\/code><\/strong><\/td><td>D\u00e9sactive l&rsquo;affichage automatique<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"navigation-dans-la-pile-d-appels\"><strong>Navigation dans la Pile d&rsquo;Appels<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Commande<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><strong><code>where<\/code><\/strong>&nbsp;(<code>w<\/code>)<\/td><td>Affiche la pile d\u2019appels compl\u00e8te<\/td><\/tr><tr><td><strong><code>up<\/code><\/strong>&nbsp;(<code>u<\/code>)<\/td><td>Remonte d\u2019un niveau dans la pile<\/td><\/tr><tr><td><strong><code>down<\/code><\/strong>&nbsp;(<code>d<\/code>)<\/td><td>Descend d\u2019un niveau dans la pile<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ipdb-encore-mieux-en-couleur\">ipdb encore mieux en couleur <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install ipdb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Faire comme avec pdb , mais avec ipdb .. et c&rsquo;est en couleur<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pourquoi-choisir-ipdb\"><strong>Pourquoi choisir ipdb ?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Auto-compl\u00e9tion avec&nbsp;<code>TAB<\/code><br>\u2705 Coloration syntaxique<br>\u2705 Historique des commandes<br>\u2705 Meilleure ergonomie que&nbsp;<code>pdb<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Python est un excellent langage pour d\u00e9buter en programmation, surtout sur Linux et Raspberry Pi. Avec ces bases, vous pouvez d\u00e9j\u00e0 cr\u00e9er des petits programmes amusants!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N&rsquo;h\u00e9sitez pas \u00e0 exp\u00e9rimenter, modifier les exemples et cr\u00e9er vos propres programmes. La pratique est la meilleure fa\u00e7on d&rsquo;apprendre.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C&rsquo;est en codant qu&rsquo;on devient codeur !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pr\u00e9sentation de Python Pr\u00e9requis Pour ce cours, nous supposons que vous avez: Installation Premiers Pas avec Python Lancer l&rsquo;interpr\u00e9teur Python Ouvrez un terminal et tapez: il faut une version 3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-3111","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python3 - workboot<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/workboot.fr\/ciela\/python3\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python3 - workboot\" \/>\n<meta property=\"og:description\" content=\"Pr\u00e9sentation de Python Pr\u00e9requis Pour ce cours, nous supposons que vous avez: Installation Premiers Pas avec Python Lancer l&rsquo;interpr\u00e9teur Python Ouvrez un terminal et tapez: il faut une version 3 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/workboot.fr\/ciela\/python3\/\" \/>\n<meta property=\"og:site_name\" content=\"workboot\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-24T14:29:39+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/python3\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/python3\\\/\",\"name\":\"Python3 - workboot\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\"},\"datePublished\":\"2025-07-28T07:44:58+00:00\",\"dateModified\":\"2025-11-24T14:29:39+00:00\",\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/workboot.fr\\\/ciela\\\/python3\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"name\":\"workboot\",\"description\":\"Open Source, Open Minds \",\"publisher\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\",\"name\":\"workboot\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"contentUrl\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"width\":1024,\"height\":950,\"caption\":\"workboot\"},\"image\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python3 - workboot","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/workboot.fr\/ciela\/python3\/","og_locale":"fr_FR","og_type":"article","og_title":"Python3 - workboot","og_description":"Pr\u00e9sentation de Python Pr\u00e9requis Pour ce cours, nous supposons que vous avez: Installation Premiers Pas avec Python Lancer l&rsquo;interpr\u00e9teur Python Ouvrez un terminal et tapez: il faut une version 3 [&hellip;]","og_url":"https:\/\/workboot.fr\/ciela\/python3\/","og_site_name":"workboot","article_modified_time":"2025-11-24T14:29:39+00:00","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/workboot.fr\/ciela\/python3\/","url":"https:\/\/workboot.fr\/ciela\/python3\/","name":"Python3 - workboot","isPartOf":{"@id":"https:\/\/workboot.fr\/ciela\/#website"},"datePublished":"2025-07-28T07:44:58+00:00","dateModified":"2025-11-24T14:29:39+00:00","inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/workboot.fr\/ciela\/python3\/"]}]},{"@type":"WebSite","@id":"https:\/\/workboot.fr\/ciela\/#website","url":"https:\/\/workboot.fr\/ciela\/","name":"workboot","description":"Open Source, Open Minds ","publisher":{"@id":"https:\/\/workboot.fr\/ciela\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/workboot.fr\/ciela\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/workboot.fr\/ciela\/#organization","name":"workboot","url":"https:\/\/workboot.fr\/ciela\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/","url":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","contentUrl":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","width":1024,"height":950,"caption":"workboot"},"image":{"@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/"}}]}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/workboot.fr\/ciela\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Pr\u00e9sentation de Python Pr\u00e9requis Pour ce cours, nous supposons que vous avez: Installation Premiers Pas avec Python Lancer l&rsquo;interpr\u00e9teur Python Ouvrez un terminal et tapez: il faut une version 3 [&hellip;]","_links":{"self":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/3111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/comments?post=3111"}],"version-history":[{"count":24,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/3111\/revisions"}],"predecessor-version":[{"id":5322,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/3111\/revisions\/5322"}],"wp:attachment":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/media?parent=3111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}