Modifications

Sauter à la navigation Sauter à la recherche
442 octets ajoutés ,  23 décembre 2015 à 19:40
Ligne 55 : Ligne 55 :     
== Charger du code sur le PyBoard ==
 
== Charger du code sur le PyBoard ==
For writing more complex code, there are two possibilities:
+
Pour l'écriture de code plus complexe, il y a deux possibilités:
   −
# edit the files on the pyboard, and load them into the REPL using import
+
# Editer le fichier sur la PyBoard puis le charger en mode REPL en utilisant la commande {{fname|import}}
# edit the files on your computer, and paste them into the REPL  
+
# Editer les fichiers sur votre ordinateur puis faire un copier/coller en mode REPL  
   −
The first solution works fine and is the only way to work with code that is split into different modules.
+
La première solution fonctionne bien, c'est la seule façon de de travailler si vous avez un code réparti dans différents modules.
   −
The second solution is perhaps easier, but you cannot paste too much text in the REPL without getting errors. You have to switch to the raw REPL by hitting Ctrl-A, pasting your code, and hitting Ctrl-D to finish the transfer. Your code will be running on the pyboard. Hit Ctrl-C to kill it if it does note terminate by itself, then hit Ctrl-B to exit the raw REPL and switch back to the friendly REPL. You can perform a soft reset of the pyboard by hitting Ctrl-D.
+
La seconde solution est peut être la plus simple mais vous ne pouvez pas envoyer trop de texte/code dans le mode REPL sans erreur. Vous aurrez besoin de passer en mode ''raw REPL'' (REPL brute) en pressant Ctrl-A, puis coller votre code, et finaliser le transfert en pressant Ctrl-D. Votre code sera exécuté sur la PyBoard. S'il ne se termine pas par lui même, vous pouvez stopper votre code en pressant Ctrl-C, puis pressez Ctrl-B pour sortir du mode ''raw REPL'' (afin de revenir au mode REPL utilisateur). Vous pouvez effectuer une réinitialisation logiciel de votre PyBoard en pressant Ctrl-D.
   −
Note than when using minicom, you have to hit Ctrl-A twice to send a Ctrl-A to the REPL because Ctrl-A is by default the escape key of minicom. You can use the paste file command in minicom to send a file to the REPL. For this:
     −
# hit Ctrl-A twice to enter the raw REPL
+
{{underline|Note pour les utilisateur de minicom:}} vous aurez besoin de presser Ctrl-A deux fois pour envoyer un Ctrl-A au REPL parce que, par défaut, Ctrl-A est aussi la touche d'échappement de minicom. Vous pouvez utiliser la commande "paste file" dans minicom pour envoyer un fichier vers REPL. Pour réaliser cela avec Minicom:
# hit Ctrl-A Y to execute the paste file minicom command
  −
# navigate to your file in the file selection screen that appears and select it
  −
# hit Ctrl-D to finish the transfer
     −
Your file is then loaded. If it contains just definitions, hit Ctrl-B to exit the rawREPL and use the definitions in the regular REPL.  
+
# Presser Ctrl-A deux fois pour entrer en mode ''raw REPL''
 +
# Presser Ctrl-A Y tpour exécuter la commande "paste file" dans minicom
 +
# Naviguer dans vos fichier apparaissant à l'écran et sélectionner le fichier à envoyer
 +
# Presser Ctrl-D pour terminer le transfert
 +
 
 +
Votre fichier est alors chargé. S'il ne contient que des définitions, pressez Ctrl-B pour sortir du mode ''raw REPL'' et utiliser les différentes définitions dans le mode REPL standard.
    
== pyboard.py ==
 
== pyboard.py ==
29 837

modifications

Menu de navigation