{"id":1734,"date":"2020-04-01T16:22:31","date_gmt":"2020-04-01T14:22:31","guid":{"rendered":"http:\/\/www.ardpylab.fr\/?page_id=1734"},"modified":"2020-05-10T15:07:41","modified_gmt":"2020-05-10T13:07:41","slug":"prise-en-main-en-mode-interactif","status":"publish","type":"page","link":"https:\/\/www.ardpylab.fr\/?page_id=1734","title":{"rendered":"Prise en main en mode interactif"},"content":{"rendered":"\n<h6><span style=\"color: #999999;\">(<em>Cliquez pour afficher la version PDF)<\/em><\/span><\/h6>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/mode-interactif.pdf\">Le mode interactif<\/a><a href=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/mode-interactif.pdf\" class=\"wp-block-file__button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n\n\n\n<p>&nbsp;<\/p>\n<p>Pour une utilisation en mode interactif, il suffit de lancer l\u2019interpr\u00e9teur \u201d<strong>IDLE<\/strong>\u201d qui se trouve dans le dossier d\u2019installation de Python 3.<\/p>\n\n\n\n<p>Une fen\u00eatre \u201dPython Shell\u201d s\u2019ouvre alors. L\u2019invite de commande &gt;&gt;&gt; signifie que Python est pr\u00eat \u00e0 ex\u00e9cuter une commande.<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"204\" class=\"wp-image-1735 aligncenter\" style=\"border: 3px solid #eeeeee; padding: 3px; margin: 3px;\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python2.png\" alt=\"\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python2.png 687w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python2-300x89.png 300w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/figure>\n<\/div>\n\n\n\n<p>Il est \u00e9galement possible d\u2019utiliser la console Python, \u00e9galement dans le dossier d\u2019installation de Python 3:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"165\" class=\"wp-image-1736 aligncenter\" style=\"border: 3px solid #eeeeee; padding: 3px; margin: 3px;\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python3.png\" alt=\"\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python3.png 680w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python3-300x73.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n<\/div>\n<p>&nbsp;<\/p>\n\n\n\n<p>La premi\u00e8re commande d\u2019apprentissage de tous les langages de programmation&nbsp;est celle qui affiche la traditionnelle phrase <strong>\u2033 Hello World ! \u2033 <\/strong>:<\/p>\n<p>Tapez&nbsp;: &nbsp;<strong>print(\u2033Hello World !\u2033)<\/strong>, puis appuyez sur la touche Entr\u00e9e.<\/p>\n<p>Python ex\u00e9cute cette commande. Le r\u00e9sultat de cette ex\u00e9cution est l\u2019affichage de la cha\u00eene de caract\u00e8res \u2033Hello World !\u2033. &nbsp;Une nouvelle invite de commande appara\u00eet alors.<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"164\" class=\"wp-image-1749 aligncenter\" style=\"border: 3px solid #eeeeee; padding: 3px; margin: 3px;\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python4.png\" alt=\"\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python4.png 686w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python4-300x72.png 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/figure>\n<\/div>\n<p>&nbsp;<\/p>\n\n\n\n<p>Avec Python, on peut \u00e9galement faire des calculs&nbsp;:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"656\" height=\"197\" class=\"wp-image-1754 aligncenter\" style=\"border: 3px solid #eeeeee; padding: 3px; margin: 3px;\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python5.png\" alt=\"\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python5.png 656w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/python5-300x90.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/figure>\n<\/div>\n\n\n\n<p><u>A noter<\/u>&nbsp;:<\/p>\n<p style=\"padding-left: 40px;\">. &nbsp;la virgule des nombres d\u00e9cimaux doit \u00eatre remplac\u00e9e par le point.<\/p>\n<p style=\"padding-left: 40px;\">. 2 exposant 5 s\u2019\u00e9crit 2**5<\/p>\n<p style=\"padding-left: 40px;\">. 12%5 renvoie le reste de la division euclidienne de 12 par 5.<\/p>\n<p>&nbsp;<\/p>\n\n\n\n<h4><strong><span style=\"color: #0000ff;\"><span style=\"color: #333333;\">1. <\/span><\/span><u><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\" data-wplink-url-error=\"true\">Variables et affectation<\/a><\/u><\/strong><\/h4>\n<p style=\"padding-left: 40px;\"><strong>. <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\/#var1\" data-wplink-url-error=\"true\">Les principaux types de donn\u00e9es<\/a><\/strong><\/p>\n<p style=\"padding-left: 80px;\">&#8211; <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\/#var2\" data-wplink-url-error=\"true\">Le type int<\/a>&nbsp;<br>&#8211; <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\/#var3\" data-wplink-url-error=\"true\">Le type float<\/a><br>&#8211; <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\/#var4\" data-wplink-url-error=\"true\">Le type bool&nbsp;<\/a><br>&#8211; <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\/#var5\" data-wplink-url-error=\"true\">Le type str<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>. <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\/#var6\" data-wplink-url-error=\"true\">Les variables<\/a><br><br><\/strong><\/p>\n<h4><strong>2. <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1812\" data-wplink-url-error=\"true\"><u>Les chaines de caract\u00e8res<\/u><\/a><\/strong><\/h4>\n<p style=\"padding-left: 40px;\"><strong>. <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1812\/#ch1\" data-wplink-url-error=\"true\">M\u00e9thodes de test de l\u2019\u00e9tat d\u2019une chaine ch<\/a><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>. <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1812\/#ch2\" data-wplink-url-error=\"true\">M\u00e9thodes retournant une nouvelle chaine<\/a><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>. <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1812\/#ch3\" data-wplink-url-error=\"true\">Indi\u00e7age des chaines de caract\u00e8res<\/a><\/strong><\/p>\n<h4><br><strong>3. <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1862\" data-wplink-url-error=\"true\">Les listes<\/a><\/span><\/strong><\/h4>\n<h4>4. <strong><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1911\" data-wplink-url-error=\"true\"><span style=\"text-decoration: underline;\">Les tuples<\/span><\/a><\/strong><\/h4>\n<h4>5. <a href=\"https:\/\/www.ardpylab.fr\/?page_id=1927\" data-wplink-url-error=\"true\"><span style=\"text-decoration: underline;\"><strong>Les dictionnaires<\/strong><\/span><\/a><\/h4>\n<p>&nbsp;<\/p>\n\n\n<div  class=\"grids-section grids-is-stretch\" style=\"--_gs-gap-desktop:0px 0px;--_gs-m-desktop:0 0 0 0;--_gs-p-desktop:0 0 0 0;--_gs-bg-desktop:transparent none;--_gs-bg-xp-desktop:0px;--_gs-zi-desktop:auto;--_gs-d-desktop:block;--_gs-mw-desktop:calc(100% - 0 - 0);--_gs-gap-tablet:0px 0px;--_gs-m-tablet:0 0 0 0;--_gs-p-tablet:0 0 0 0;--_gs-bg-tablet:transparent none;--_gs-bg-xp-tablet:0px;--_gs-zi-tablet:auto;--_gs-d-tablet:block;--_gs-mw-tablet:calc(100% - 0 - 0);--_gs-gap-mobile:0px 0px;--_gs-m-mobile:0 0 0 0;--_gs-p-mobile:0 0 0 0;--_gs-bg-mobile:transparent none;--_gs-bg-xp-mobile:0px;--_gs-zi-mobile:auto;--_gs-d-mobile:block;--_gs-mw-mobile:calc(100% - 0 - 0);--_gs-columns:2;--_gs-rows:1\"><div class=\"grids-s-w_i\">\n<div class=\"grids-area\" style=\"--_ga-column:1\/2;--_ga-row:1\/2;--_ga-m-desktop:0 0 0 0;--_ga-p-desktop:0 0 0 0;--_ga-bg-desktop:transparent none;--_ga-zi-desktop:auto;--_ga-d-desktop:flex;--_ga-mw-desktop:calc(100% - 0 - 0);--_ga-m-tablet:0 0 0 0;--_ga-p-tablet:0 0 0 0;--_ga-bg-tablet:transparent none;--_ga-zi-tablet:auto;--_ga-d-tablet:flex;--_ga-mw-tablet:calc(100% - 0 - 0);--_ga-m-mobile:0 0 0 0;--_ga-p-mobile:0 0 0 0;--_ga-bg-mobile:transparent none;--_ga-zi-mobile:auto;--_ga-d-mobile:flex;--_ga-mw-mobile:calc(100% - 0 - 0)\">\n\n<div class=\"wp-block-image\"><figure class=\"alignleft size-large\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=266\"><img loading=\"lazy\" decoding=\"async\" width=\"50\" height=\"28\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/moins.jpg\" alt=\"\" class=\"wp-image-107\"\/><\/a><\/figure><\/div>\n\n<\/div>\n\n<div class=\"grids-area\" style=\"--_ga-column:2\/3;--_ga-row:1\/2;--_ga-m-desktop:0 0 0 0;--_ga-p-desktop:0 0 0 0;--_ga-bg-desktop:transparent none;--_ga-zi-desktop:auto;--_ga-d-desktop:flex;--_ga-mw-desktop:calc(100% - 0 - 0);--_ga-m-tablet:0 0 0 0;--_ga-p-tablet:0 0 0 0;--_ga-bg-tablet:transparent none;--_ga-zi-tablet:auto;--_ga-d-tablet:flex;--_ga-mw-tablet:calc(100% - 0 - 0);--_ga-m-mobile:0 0 0 0;--_ga-p-mobile:0 0 0 0;--_ga-bg-mobile:transparent none;--_ga-zi-mobile:auto;--_ga-d-mobile:flex;--_ga-mw-mobile:calc(100% - 0 - 0)\">\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1789\"><img loading=\"lazy\" decoding=\"async\" width=\"50\" height=\"28\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/plus.jpg\" alt=\"\" class=\"wp-image-106\"\/><\/a><\/figure><\/div>\n\n<\/div>\n<\/div><\/div>\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>(Cliquez pour afficher la version PDF) &nbsp; Pour une utilisation en mode interactif, il suffit de lancer l\u2019interpr\u00e9teur \u201dIDLE\u201d qui se trouve dans le dossier d\u2019installation de Python 3. Une fen\u00eatre \u201dPython Shell\u201d s\u2019ouvre alors. L\u2019invite de commande &gt;&gt;&gt; signifie que Python est pr\u00eat \u00e0 ex\u00e9cuter une commande. Il est \u00e9galement possible d\u2019utiliser la console [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1734","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/1734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1734"}],"version-history":[{"count":0,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/1734\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}