Modifications

Sauter à la navigation Sauter à la recherche
141 octets ajoutés ,  10 novembre 2016 à 22:03
Ligne 23 : Ligne 23 :  
{{traduction}}
 
{{traduction}}
   −
Try using the code on your computer first with the [http://www.python.org/ desktop version of Python] before trying it in MicroPython. In a terminal navigate to the same directory as the test.py file (this is very important, '''you must be in the same directory as test.py'''!) and run the '''python3''' command (or '''python''' if using Python 2.x). At the Python REPL enter the following commands:
+
Testez d'abord ce code depuis votre ordinateur avec [http://www.python.org/ la version PC de Python] avant de l'essayer sur MicroPython. Dans un termminal, naviguez dans le répertoire contenant le fichier test.py (ceci est très important, '''vous devez vous trouver dans le même répertoire que test.py'''!) puis exécutez la commande '''python3''' (ou '''python''' si vous utilisez Python 2.x).  
 +
 
 +
Saisissez les commandes suivantes sur l'invite de commande Python (ou invite REPL... lorsque vous testerez sous MicroPython):
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
Ligne 29 : Ligne 31 :  
test.add(1, 1)
 
test.add(1, 1)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
{{traduction}}
    
You should see the add function called and the result of 1 + 1 returned.  If you see an {{fname|ImportError}} that the test module can't be found make sure you're running Python from the same directory as test.py is located.
 
You should see the add function called and the result of 1 + 1 returned.  If you see an {{fname|ImportError}} that the test module can't be found make sure you're running Python from the same directory as test.py is located.
29 918

modifications

Menu de navigation