{"id":161,"date":"2018-10-31T15:28:17","date_gmt":"2018-10-31T14:28:17","guid":{"rendered":"http:\/\/www.boichat.ch\/wpjrsp\/?p=161"},"modified":"2021-08-07T18:42:44","modified_gmt":"2021-08-07T16:42:44","slug":"extension-plugin-pydev-pour-eclipse","status":"publish","type":"post","link":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/","title":{"rendered":"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi)"},"content":{"rendered":"\r\nDate de la derni\u00e8re modification: 7 ao\u00fbt 2021\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<p>Cet article a \u00e9t\u00e9 soumis en mars 2019 \u00e0 <a href=\"https:\/\/www.developpez.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">developpez.com<\/a>\u00a0et est maintenant disponible sous le titre\u00a0<strong><a href=\"https:\/\/boichat.developpez.com\/tutoriels\/python\/apprendre-utiliser-pydev\/\" target=\"_blank\" rel=\"noopener noreferrer\">PyDev, un IDE pour Python, sous Eclipse et pour le Raspberry Pi 3<\/a><\/strong>.<\/p>\r\n<p><strong>Je l&rsquo;ai r\u00e9utilis\u00e9 sans aucun souci, en \u00e9t\u00e9 2021, lors de l&rsquo;installation d&rsquo;un nouveau PC avec Eclipse, Java, Python et tout le reste.<\/strong><br \/><strong>Je suis beaucoup moins actif sur ces sujets, ayant beaucoup de travail et de plaisir pour mon nouveau domaine de comp\u00e9tence:\u00a0 <br \/><a href=\"http:\/\/Imprimante 3D - Creality Ender 3 V2\" target=\"_blank\" rel=\"noopener noreferrer\">Imprimante 3D &#8211; Creality Ender 3 V2<\/a>.<\/strong><br \/><br \/><\/p>\r\n<h3>Introduction<\/h3>\r\n<p>Cet article est destin\u00e9 au programmeur <a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python<\/a> d\u00e9veloppant des applications pour le <a href=\"https:\/\/www.raspberrypi.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Raspberry Pi 3<\/a> ou Pi 4 et peut \u00eatre consid\u00e9r\u00e9 comme une extension de mon livre <a href=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/26\/le-contenu-du-livre\/\" target=\"_blank\" rel=\"noopener noreferrer\">Programmer en Java avec un Raspberry Pi<\/a>.<\/p>\r\n<p>Comme c&rsquo;est expliqu\u00e9 dans le livre, nous utilisons des scripts Python pour tester nos composants attach\u00e9s au <a href=\"https:\/\/www.raspberrypi.org\/documentation\/usage\/gpio\/\" target=\"_blank\" rel=\"noopener noreferrer\">port GPIO<\/a>, comme d\u00e9fini dans les sch\u00e9mas <a href=\"http:\/\/fritzing.org\/home\/\" target=\"_blank\" rel=\"noopener noreferrer\">Fritzing<\/a>.<\/p>\r\n<p>Dans mon ouvrage, qui a d\u00fb rester avec un nombre de pages restreintes, \u00e0 cause du format couleur, nous avons d\u00fb nous contenter, aussi \u00e0 cause des nombreux sujets trait\u00e9s, de ne faire qu&rsquo;une introduction rapide \u00e0 Python en indiquant aussi comment l&rsquo;installer sur le PC.<\/p>\r\n<p>Une installation sur le PC n&rsquo;est pas n\u00e9cessaire, car les scripts Pythons d\u00e9crits dans le livre peuvent \u00eatre simplement t\u00e9l\u00e9charg\u00e9s sur le Raspberry Pi pour v\u00e9rifier les composants mont\u00e9s sur nos planches \u00e0 pain.<\/p>\r\n<p>Cet article nous montre comment installer le PyDev, un IDE Python pour Eclipse, sur un PC Windows, et y \u00e9crire une <strong>librairie fictive <a href=\"https:\/\/pypi.org\/project\/RPi.GPIO\/\" target=\"_blank\" rel=\"noopener noreferrer\">RPi.GPIO<\/a> <\/strong>pour que le script Python <span style=\"font-size: 14pt;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">blink2leds.py<\/span><\/strong><\/span>\u00a0(chapitre 6) puisse \u00eatre ex\u00e9cut\u00e9 sur le PC sans GPIO hardware (chapitre 5) et avant le d\u00e9ploiement sur le Raspberry Pi.<\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\"># coding: utf-8<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">import RPi.GPIO as GPIO<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">import time<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">LedPin1 = 12 # pin15 (Pi4J GPIO_01)<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">LedPin2 = 15 # pin15 (Pi4J GPIO_03)<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\"># pin3 la terre<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">def setup():<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">print(\u00ab\u00a0Les deux leds vont clignoter\u00a0\u00bb)<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.setmode(GPIO.BOARD) # Num\u00e9ro GPIO par location physique<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.setup(LedPin1, GPIO.OUT) # LedPin1 en mode output<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.setup(LedPin2, GPIO.OUT) # LedPin2 en mode output<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">def blink():<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">i = 0<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">while i &lt; 15: # Pour 15 sec<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin1, GPIO.HIGH) # Allume la led<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin2, GPIO.HIGH) # Allume la led<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">time.sleep(.5)<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin1, GPIO.LOW) # Eteint la led<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin2, GPIO.LOW) # Eteint la led<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">time.sleep(.5)<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">i += 1<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">print(\u00ab\u00a0Une seule led va clignoter plus lentement\u00a0\u00bb)<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">while True: # Pour une boucle \u00e9ternelle<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin2, GPIO.HIGH) # Allume la led<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">time.sleep(1)<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin2, GPIO.LOW) # Eteint la led<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">time.sleep(1)<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">def destroy():<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin1, GPIO.LOW) # Led \u00e9teinte<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.output(LedPin2, GPIO.LOW) # Led \u00e9teinte<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">GPIO.cleanup() # Ressources liber\u00e9es<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">if __name__ == &lsquo;__main__&rsquo;: # D\u00e9marrage en Python<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">setup()<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">try:<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">blink()<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">except KeyboardInterrupt: # Interruption avec &lsquo;Ctrl+C&rsquo;<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">destroy()<\/span><\/p>\r\n<p>Ce script est vraiment simple et ne n\u00e9cessiterait pas vraiment une v\u00e9rification sur le PC. Cependant, si le lecteur d\u00e9sirerait \u00e9tendre ce script avec des fonctionnalit\u00e9s plus d\u00e9licates, un d\u00e9veloppement et des tests sur le PC seraient profitables. Rappelons aussi qu&rsquo;il est possible d&rsquo;ex\u00e9cuter des scripts Python depuis Java, avec la classe\u00a0<span style=\"font-family: 'courier new', courier, monospace;\"><strong><span style=\"font-size: 14pt;\">ProcessBuilder<\/span><\/strong><\/span>, et d&rsquo;en extraire la r\u00e9ponse (chapitre 13).<\/p>\r\n<h3>Installation de PyDev dans Eclipse<\/h3>\r\n<p>Je ne d\u00e9crirai pas ici l&rsquo;installation d&rsquo;Eclipse ni son utilisation (chapitre 1 et 2). J&rsquo;assume que le lecteur le connais d\u00e9j\u00e0. Pour v\u00e9rifier cet article, je l&rsquo;ai install\u00e9 sur une de mes versions anciennes, Neon, ainsi qu&rsquo;un workspace s\u00e9par\u00e9\u00a0 (<span style=\"font-family: 'courier new', courier, monospace;\">D:\\EclipseWorkspaceNeon<\/span>). J&rsquo;ai install\u00e9 la version\u00a0Eclipse IDE for Java Developers, mais une version Eclipse IDE for C\/C++ Developers devrait fonctionner. Le m\u00eame espace de travail que Java peut aussi \u00eatre utilis\u00e9: nous pourrons alors d\u00e9velopper aussi bien nos classes Java que des scripts Python, d\u00e9di\u00e9s ou non au Raspberry Pi.<\/p>\r\n<p>Nous trouverons une description de l&rsquo;installation sur\u00a0 <a href=\"http:\/\/www.pydev.org\/manual_101_install.html\" target=\"_blank\" rel=\"noopener noreferrer\">www.pydev.org<\/a> .<br \/>Avec le menu\u00a0<em><strong>Help &gt; Install New Software&#8230;<\/strong><\/em> nous d\u00e9poserons dans la fen\u00eatre du bouton Add la s\u00e9lection\u00a0<strong>http:\/\/www.pydev.org\/updates<\/strong>.<\/p>\r\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-173\" src=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg\" alt=\"\" width=\"433\" height=\"248\" srcset=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg 300w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-768x440.jpg 768w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall.jpg 892w\" sizes=\"(max-width: 433px) 100vw, 433px\" \/><\/p>\r\n<p>Nous ne cocherons que le premier, <em><strong>PyDev<\/strong> <\/em>(Mylyn n&rsquo;\u00e9tant pas \u00ab\u00a0encore\u00a0\u00bb utilis\u00e9), avant de cliquer sur le bouton <em><strong>Next<\/strong><\/em>,deux fois, et accepter la \u00ab\u00a0licence agreement\u00a0\u00bb et un <em><strong>OK<\/strong> <\/em>final pour le logiciel non sign\u00e9. Il faudra red\u00e9marrer Eclipse.<\/p>\r\n<h3>Installation de Python sur Windows<\/h3>\r\n<p>Le script pr\u00e9c\u00e9demment montr\u00e9 ( <span style=\"font-size: 14pt;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">blink2leds.py<\/span><\/strong><\/span> ) fonctionne sur le Raspberry Pi\u00a0 sous la version 2 de Python, c&rsquo;est implicite. Mais une commande <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">python<strong>3<\/strong>\u00a0blink2leds.py<\/span> va aussi montrer nos deux LEDS clignoter, donc avec la version 3.<\/p>\r\n<p>Nous\u00a0 allons donc installer la version\u00a03.5.3, celle retourn\u00e9e par la commande<br \/><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">python3\u00a0&#8212;\u00a0version<\/span><br \/>sur le Raspberry Pi (image <a href=\"https:\/\/www.raspbian.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Raspbian<\/a> utilis\u00e9: <span style=\"font-family: 'courier new', courier, monospace;\">2018-06-27-raspbian-stretch.img<\/span>, voir chapitre 3) .<\/p>\r\n<p>Nous devrons t\u00e9l\u00e9charger Python, si pas encore install\u00e9, depuis <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.python.org\/downloads\/<\/a>. Avec\u00a0 le nom <strong><em>Windows x86 executable installer <\/em><\/strong>nous recevrons\u00a0\u00a0<span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">python-3.5.3.exe<\/span> que nous ex\u00e9cuterons:<\/p>\r\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-177\" src=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/pythoninstall-300x186.jpg\" alt=\"\" width=\"477\" height=\"296\" srcset=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/pythoninstall-300x186.jpg 300w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/pythoninstall-768x475.jpg 768w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/pythoninstall-1024x633.jpg 1024w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/pythoninstall.jpg 1172w\" sizes=\"(max-width: 477px) 100vw, 477px\" \/><\/p>\r\n<p>Nous choisirons <strong><em>Customize installation<\/em><\/strong>\u00a0afin de choisir un r\u00e9pertoire d&rsquo;installation, comme par exemple\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">D:\\Python\\Python35-32<\/span>.\u00a0 Nous aimons bien ne pas saturer le disque <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">C:<\/span> souvent un SSD.<\/p>\r\n<p>Il est tout \u00e0 fait possible\u00a0 d&rsquo;installer la version 2 de Python qui sera cette fois-ci disponible avec l&rsquo;extension\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">msi<\/span>: <span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">python-2.7.13.msi<\/span>. Il est conseill\u00e9 d&rsquo;utiliser le r\u00e9pertoire\u00a0 <span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">D:\\Python\\Python27_13<\/span>: ce sera plus ais\u00e9 de passer d&rsquo;un \u00e0 l&rsquo;autre par un changement de configuration.<\/p>\r\n<p>Au chapitre 19 nous expliquons comment convertir le script\u00a0\u00a0<strong><span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">ultrasonic.py<\/span><\/strong> de Python 2 \u00e0 Python 3 et de l&rsquo;ex\u00e9cuter sur un Raspberry Pi avec la commande <span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\"><strong>python3<\/strong><\/span>.<\/p>\r\n<h3>Configuration de PyDev dans Eclipse<\/h3>\r\n<p>La premi\u00e8re chose est de sp\u00e9cifier l\u2019interpr\u00e9teur Python d&rsquo;Eclipse. Sans passer par cette configuration, nous ne pourrons pas cr\u00e9er un projet d\u00e9di\u00e9 \u00e0 Python.<\/p>\r\n<p>Pour cette configuration nous irons sous le menu <em><strong>Window \/ Preferences \/ PyDev \/ Interpreters<\/strong><\/em> et finalement <em><strong>Python Interpreter<\/strong><\/em>. Le bouton en haut \u00e0 droite nous permettra d&rsquo;entrer l&rsquo;information: la seconde pour l&rsquo;ex\u00e9cutable suffira:<\/p>\r\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-183\" src=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonInterpreter-300x201.jpg\" alt=\"\" width=\"454\" height=\"304\" srcset=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonInterpreter-300x201.jpg 300w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonInterpreter-768x514.jpg 768w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonInterpreter-1024x686.jpg 1024w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonInterpreter.jpg 1177w\" sizes=\"(max-width: 454px) 100vw, 454px\" \/><\/p>\r\n<p>Le bouton <em><strong>Browse<\/strong> <\/em>nous permettra de naviguer entre les deux versions de Python si nous les avons install\u00e9es les deux. A tout moment nous pourrons en activer une autre, en installant la nouvelle (<em><strong>Add<\/strong><\/em>) et effa\u00e7ant l&rsquo;ancienne (<em><strong>Remove<\/strong><\/em>).<\/p>\r\n<p>Ensuite nous installerons notre premier projet d\u00e9di\u00e9 \u00e0 Python, comme nous l&rsquo;avons d\u00e9j\u00e0 fait pour Java dans le livre et par chapitre.<\/p>\r\n<h3>Eclipse Python projet<\/h3>\r\n<p>Pour obtenir cette fen\u00eatre il nous suffira d&rsquo;utiliser le menu <em><strong>File \/ New \/ Projet<\/strong><\/em>\u00a0et <em><strong>PyDev Project<\/strong><\/em>:<\/p>\r\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-180\" src=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonProject-252x300.jpg\" alt=\"\" width=\"410\" height=\"488\" srcset=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonProject-252x300.jpg 252w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonProject-768x914.jpg 768w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonProject-861x1024.jpg 861w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/EclipsePythonProject.jpg 932w\" sizes=\"(max-width: 410px) 100vw, 410px\" \/><\/p>\r\n<p>Nous cr\u00e9erons un projet <strong>PythonPremierPas<\/strong>\u00a0et Eclipse nous demandera d&rsquo;accepter la perspective PyDev qui est plus que judicieuse.<\/p>\r\n<p>De la m\u00eame mani\u00e8re que les projets Java d\u00e9di\u00e9 au Raspberry Pi, en s\u00e9lectionnant le projet <strong>PythonPremierPas<\/strong>\u00a0, nous pourrons cr\u00e9er, pr\u00e9parer et ex\u00e9cuter nos scripts Python sous Eclipse.\u00a0 Toutes les proc\u00e9dures n\u00e9cessaires avant d&rsquo;ex\u00e9cuter notre premier script Python\u00a0 sont similaire \u00e0 Java (chapitre 2 &#8211;\u00a0Ma\u00eetriser Eclipse d&rsquo;abord).<\/p>\r\n<p>Nous pourrons pr\u00e9parer notre premier script Python, ici en Python 3,\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\"><strong>hello.py<\/strong><\/span>:<\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\"># This program prints Salut au Raspberry Pi<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\"># followed by Bravo!<\/span><\/p>\r\n<p><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">print(&lsquo;Salut au Raspberry Pi&rsquo;)<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; background-color: #ffff99;\">print(&lsquo;Bravo&rsquo;)<\/span><\/p>\r\n<p>L&rsquo;avantage de mettre deux lignes est de pouvoir v\u00e9rifier le d\u00e9bogueur et stopper sur une ligne. C&rsquo;est pareil \u00e0 Java. Dans la console, nous pourrions voir:<\/p>\r\n<p><span style=\"background-color: #ff0000; font-family: 'courier new', courier, monospace; font-size: 14pt;\">pydev debugger: starting (pid: 6248)<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">Salut au Raspberry Pi<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">Bravo<\/span><\/p>\r\n<h3>Retour \u00e0 blink2leds.py<\/h3>\r\n<p>Le script Python ci-dessus,\u00a0<strong><span style=\"font-family: 'courier new', courier, monospace;\">blink2leds.py<\/span><\/strong>, sera d\u00e9pos\u00e9 dans le projet\u00a0<strong>PythonPremierPas<\/strong>\u00a0avec <em><strong>New \/ File<\/strong> <\/em>comme pour\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\"><strong>hello.py.<br \/><\/strong><\/span><\/p>\r\n<p>Nous avons expliqu\u00e9 pour Java comment copier un fichier, ici\u00a0\u00a0<strong><span style=\"font-family: 'courier new', courier, monospace;\">blink2leds.py <\/span><\/strong>(qui vient avec le livre, car utilis\u00e9), directement dans le r\u00e9pertoire\u00a0<span style=\"font-family: 'courier new', courier, monospace;\">D:\\EclipseWorkspaceNeon\\PythonPremiersPas<\/span>\u00a0 de l&rsquo;explorateur de Windows, et d&rsquo;ex\u00e9cuter ensuite un <em><strong>F5<\/strong><\/em> (refresh) sur ce projet dans Eclipse.<\/p>\r\n<p>Il est clair que nos verrons tout de suite le probl\u00e8me: nous n&rsquo;avons pas de librairie <span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\"><strong>RPi.GPIO<\/strong><\/span> sur le PC:<\/p>\r\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-188\" src=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/SansLibrairieGPIO-300x167.jpg\" alt=\"\" width=\"565\" height=\"315\" srcset=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/SansLibrairieGPIO-300x167.jpg 300w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/SansLibrairieGPIO-768x428.jpg 768w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/SansLibrairieGPIO.jpg 1006w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/p>\r\n<h3>Installation d&rsquo;une librairie GPIO fictive dans Eclipse<\/h3>\r\n<p>Pour cette partie il est plus facile d&rsquo;utiliser l&rsquo;explorateur de Windows dans le r\u00e9pertoire de l&rsquo;espace de travail de notre projet Eclipse: <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">D:\\EclipseWorkspaceNeon\\PythonPremiersPas<\/span><\/strong> et ensuite d&rsquo;ex\u00e9cuter un <em><strong>Refresh<\/strong> <\/em>ou <em><strong>F5<\/strong> <\/em>sur le projet en question.<\/p>\r\n<p>Les actions suivantes sont requises:<\/p>\r\n<ul>\r\n<li><strong>Cr\u00e9ation d&rsquo;un r\u00e9pertoire <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">RPi\u00a0<\/span><\/strong><\/li>\r\n<li><strong>Cr\u00e9ation dans le r\u00e9pertoire <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">RPi<\/span> d&rsquo;un fichier <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">__init__.py<\/span><\/strong>, mais\u00a0<strong>VIDE<\/strong>. C&rsquo;est le fichier d&rsquo;initialisation de la biblioth\u00e8que<\/li>\r\n<li><strong>Cr\u00e9ation dans le r\u00e9pertoire <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">RPi<\/span>\u00a0d &lsquo;un fichier <span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">GPIO.py<\/span><\/strong> comme ceci (<a href=\"http:\/\/www.boichat.ch\/codesource\/GPIO.zip\" target=\"_blank\" rel=\"noopener noreferrer\">le code source zipp\u00e9 de ce fichier ici<\/a>):<\/li>\r\n<\/ul>\r\n<table style=\"height: 553px;\">\r\n<tbody>\r\n<tr style=\"height: 553px;\">\r\n<td style=\"height: 553px; width: 587.429px;\" bgcolor=\"#e6faff\">\r\n<pre>import time\r\n\r\nBOARD = 1\r\nOUT = 1\r\nIN = 1\r\nHIGH=1\r\nLOW=0\r\nPUD_DOWN=0\r\n\r\ndef setmode(arg):\r\n   print (arg)\r\n\r\ndef setup(pin, state, initial=-1, pull_up_down=-1):\r\n   print \"setup:\", pin, \"with\", state\r\n\r\ndef output(arg1, arg2):\r\n   print \"output: \" ,arg1, \"-\" ,arg2\r\n\r\ndef input(arg1):\r\n   print \" input: \" ,arg1\r\n   time.sleep(0.1)\r\n   return (1)\r\n\r\ndef cleanup():\r\n   print \" cleanup \"\r\n\r\ndef setwarnings(flag):\r\n   print \" setwarning: \" + flag<\/pre>\r\n<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p>Je conseillerais d&rsquo;installer et d&rsquo;utiliser Notepad++ (chapitre 1) pour l&rsquo;indentation \u00e0 3 espaces.<\/p>\r\n<p>Toutes les fonctions utilis\u00e9es par\u00a0<strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">blink2leds.py<\/span><\/strong>\u00a0seront donc simul\u00e9es par des <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">print<\/span><\/strong>\u00a0en Python.\u00a0 <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\"><strong>GPIO.py<\/strong><\/span>\u00a0est en Python 3, mais fonctionnera en Python 2. Nous avons introduit l&rsquo;<strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">input<\/span><\/strong> qui est un peu diff\u00e9rent: nous avons test\u00e9 le script <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">ultrasonic.py<\/span><\/strong> du chapitre 19 qui en avait besoin et qui mesure une distance. C&rsquo;est clair que du code de simulation devrait \u00eatre introduit, car ce script doit recevoir diff\u00e9rentes valeurs d&rsquo;<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\"><strong>input<\/strong><\/span> suivant le retour du signal ultrasonique apr\u00e8s r\u00e9fection sur un objet.<\/p>\r\n<h3>Test de notre blink2leds.py<\/h3>\r\n<p>Dans cette exemple nous avons avons stopp\u00e9 avec le d\u00e9bogueur sur la ligne 26 (<span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">i += 1<\/span>)\u00a0 pour limiter les prints sur la console d&rsquo;Eclipse:<\/p>\r\n<p><span style=\"background-color: #ccffcc;\">pydev debugger: starting (pid: 5972)<\/span><br \/><span style=\"background-color: #ccffcc;\">Les deux leds vont clignoter<\/span><br \/><span style=\"background-color: #ccffcc;\">1<\/span><br \/><span style=\"background-color: #ccffcc;\">(&lsquo;setup: &lsquo;, 12, &lsquo;-&lsquo;, 1)<\/span><br \/><span style=\"background-color: #ccffcc;\">(&lsquo;setup: &lsquo;, 15, &lsquo;-&lsquo;, 1)<\/span><br \/><span style=\"background-color: #ccffcc;\">(&lsquo;output: &lsquo;, 12, &lsquo;-&lsquo;, 1)<\/span><br \/><span style=\"background-color: #ccffcc;\">(&lsquo;output: &lsquo;, 15, &lsquo;-&lsquo;, 1)<\/span><br \/><span style=\"background-color: #ccffcc;\">(&lsquo;output: &lsquo;, 12, &lsquo;-&lsquo;, 0)<\/span><br \/><span style=\"background-color: #ccffcc;\">(&lsquo;output: &lsquo;, 15, &lsquo;-&lsquo;, 0)<\/span><\/p>\r\n<p>Les parenth\u00e8ses viennent des prints du fichier GPIO.py \u00e9crit en Python 3, mais qui apparaissent ici, car notre Eclipse est pr\u00e9sentement configur\u00e9 avec l\u2019interpr\u00e9teur Python 2. Nous voyons bien les 12 et 15 des broches physiques d\u00e9crites au chapitre 5, et les 1 et 0 correspondant \u00e0 nos LEDS qui s&rsquo;allument et s&rsquo;\u00e9teignent.<\/p>\r\n<h3>Transfert des fichiers .py du PC au Raspberry Pi<\/h3>\r\n<p>Pour ce projet et cette configuration, nos fichiers Python seront dans le r\u00e9pertoire\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">D:\\EclipseWorkspaceNeon\\PythonPremiersPas<\/span>.<\/p>\r\n<p>L&rsquo;outil de transfert WinScp (chapitre 4) nous permettra de copier nos fichiers Python dans le r\u00e9pertoire cr\u00e9\u00e9 \u00e0 cet effet sur Les Raspberry Pi: <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">\/home\/pi\/python<\/span>. Je conseillerai d&rsquo;utiliser l&rsquo;extension <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">.py3<\/span><\/strong> pour des scripts utilisant la version 3 de Python.<\/p>\r\n<p>PuTTY (chapitre 4) nous permettra d&rsquo;ex\u00e9cuter ces scripts avec <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">python<\/span><\/strong>\u00a0ou <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">python3<\/span><\/strong>\u00a0dans une console de Raspbian.<\/p>\r\n<h3>D\u00e9bogage \u00e0 distance<\/h3>\r\n<p>Le d\u00e9bogage en Python est similaire \u00e0 Java. Nous pouvons s\u00e9lectionner les lignes de point d&rsquo;arr\u00eat, faire du pas \u00e0 pas\u00a0 (<em><strong>F5<\/strong> <\/em>-&gt; <em><strong>F8<\/strong><\/em>) ou stopper avec le carr\u00e9 rouge bien connu.<\/p>\r\n<p>Je n&rsquo;ai ni trouv\u00e9 le temps ni l&rsquo;opportunit\u00e9 d&rsquo;installer et de v\u00e9rifier le d\u00e9bogage \u00e0 distance sur un Raspberry Pi\u00a0 avec PyDev sous Eclipse. Je l&rsquo;ai fait pour Java et s&rsquo;est expliqu\u00e9 au chapitre 15 pour le relais\u00a05 VDC.<br \/><a href=\"https:\/\/stackoverflow.com\/questions\/35066784\/how-to-setup-remote-debugging-with-eclipse-and-pydev\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>L&rsquo;article ici<\/strong><\/a> pourrait aider\u00a0 un lecteur explorateur.<\/p>","protected":false},"excerpt":{"rendered":"<p>&nbsp; Cet article a \u00e9t\u00e9 soumis en mars 2019 \u00e0 developpez.com\u00a0et est maintenant disponible sous le titre\u00a0PyDev, un IDE pour Python, sous Eclipse et pour&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi) - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3<\/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:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi) - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\" \/>\n<meta property=\"og:description\" content=\"&nbsp; Cet article a \u00e9t\u00e9 soumis en mars 2019 \u00e0 developpez.com\u00a0et est maintenant disponible sous le titre\u00a0PyDev, un IDE pour Python, sous Eclipse et pour&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/\" \/>\n<meta property=\"og:site_name\" content=\"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-31T14:28:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-07T16:42:44+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jean-Bernard Boichat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#website\",\"url\":\"https:\/\/www.boichat.ch\/wpjrsp\/\",\"name\":\"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\",\"description\":\"Jean-Bernard Boichat - Auteur chez Eyrolles\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.boichat.ch\/wpjrsp\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#primaryimage\",\"inLanguage\":\"fr-FR\",\"url\":\"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg\",\"contentUrl\":\"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#webpage\",\"url\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/\",\"name\":\"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi) - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\",\"isPartOf\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#primaryimage\"},\"datePublished\":\"2018-10-31T14:28:17+00:00\",\"dateModified\":\"2021-08-07T16:42:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.boichat.ch\/wpjrsp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi)\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751\",\"name\":\"Jean-Bernard Boichat\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#personlogo\",\"inLanguage\":\"fr-FR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g\",\"caption\":\"Jean-Bernard Boichat\"},\"sameAs\":[\"http:\/\/www.boichat.ch\"],\"url\":\"https:\/\/www.boichat.ch\/wpjrsp\/author\/bjb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi) - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","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:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/","og_locale":"fr_FR","og_type":"article","og_title":"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi) - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","og_description":"&nbsp; Cet article a \u00e9t\u00e9 soumis en mars 2019 \u00e0 developpez.com\u00a0et est maintenant disponible sous le titre\u00a0PyDev, un IDE pour Python, sous Eclipse et pour&hellip;","og_url":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/","og_site_name":"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","article_published_time":"2018-10-31T14:28:17+00:00","article_modified_time":"2021-08-07T16:42:44+00:00","og_image":[{"url":"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg"}],"twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"Jean-Bernard Boichat","Dur\u00e9e de lecture estim\u00e9e":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.boichat.ch\/wpjrsp\/#website","url":"https:\/\/www.boichat.ch\/wpjrsp\/","name":"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","description":"Jean-Bernard Boichat - Auteur chez Eyrolles","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.boichat.ch\/wpjrsp\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"fr-FR"},{"@type":"ImageObject","@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#primaryimage","inLanguage":"fr-FR","url":"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg","contentUrl":"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/11\/PiDevInstall-300x172.jpg"},{"@type":"WebPage","@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#webpage","url":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/","name":"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi) - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","isPartOf":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#primaryimage"},"datePublished":"2018-10-31T14:28:17+00:00","dateModified":"2021-08-07T16:42:44+00:00","author":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751"},"breadcrumb":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.boichat.ch\/wpjrsp\/"},{"@type":"ListItem","position":2,"name":"PyDev, un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi)"}]},{"@type":"Person","@id":"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751","name":"Jean-Bernard Boichat","image":{"@type":"ImageObject","@id":"https:\/\/www.boichat.ch\/wpjrsp\/#personlogo","inLanguage":"fr-FR","url":"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g","caption":"Jean-Bernard Boichat"},"sameAs":["http:\/\/www.boichat.ch"],"url":"https:\/\/www.boichat.ch\/wpjrsp\/author\/bjb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/posts\/161"}],"collection":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":0,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}