Ligne 1 : |
Ligne 1 : |
| {{FEATHER-CHARGER-FICHIER-MICROPYTHON-NAV}} | | {{FEATHER-CHARGER-FICHIER-MICROPYTHON-NAV}} |
− |
| |
− | {{traduction}}
| |
| | | |
| == Opérations sur fichiers == | | == Opérations sur fichiers == |
Ligne 26 : |
Ligne 24 : |
| | | |
| == Lire des fichiers depuis la carte == | | == Lire des fichiers depuis la carte == |
− | The '''get''' command can read and copy files from a MicroPython board to your computer.
| + | La commande '''get''' permet de lire un fichier sur la carte MicroPython et d'en copier le contenu sur votre ordinateur. |
| | | |
− | For example to print the contents of '''/boot.py''' from a board run the following command:
| + | Par exemple, pour {{underline|afficher}} le contenu du fichier '''/boot.py''' de la carte PyBoard, vous pouvez saisir la commande suivante: |
| | | |
| <nowiki>ampy --port /serial/port get boot.py</nowiki> | | <nowiki>ampy --port /serial/port get boot.py</nowiki> |
Ligne 34 : |
Ligne 32 : |
| {{ADFImage|FEATHER-CHARGER-FICHIER-MICROPYTHON-FILEOP-30.png}} | | {{ADFImage|FEATHER-CHARGER-FICHIER-MICROPYTHON-FILEOP-30.png}} |
| | | |
− | This will print out the contents of '''boot.py''' from the board's root directory.
| + | Cela affiche le contenu de '''boot.py''' contenu dans le répertoire racine de la carte MicroPython. |
| | | |
− | You can instead copy the contents of '''boot.py''' into a file on your computer by specifying the path to the file to save as a second argument. For example to copy '''/boot.py''' from a board to a file '''board_boot.py''' on your computer you can run:
| + | Vous pouvez également copier le contenu du fichier '''boot.py''' dans un fichier sur votre ordinateur. Pour réaliser un telle opération, vous ajoutez un paramètre complémentaire à la commande, paramètre qui indique le nom du fichier dans lequel le contenu doit être stocké. Par exemple, vous pouvez saisir la commande suivante pour copier '''/boot.py''' depuis la carte dans le fichier '''board_boot.py''' sur l'ordinateur: |
| | | |
| <nowiki>ampy --port /serial/port get boot.py board_boot.py</nowiki> | | <nowiki>ampy --port /serial/port get boot.py board_boot.py</nowiki> |
Ligne 42 : |
Ligne 40 : |
| {{ADFImage|FEATHER-CHARGER-FICHIER-MICROPYTHON-FILEOP-31.png}} | | {{ADFImage|FEATHER-CHARGER-FICHIER-MICROPYTHON-FILEOP-31.png}} |
| | | |
− | {{ambox-stop|text= The get command will always overwrite files on the computer without warning!}} | + | {{ambox-stop|text=La commande {{fname|get}} écrasera toujours le fichier destinataire sur l'ordinateur. Sans avertissement!}} |
| | | |
− | == Créer des répertoire == | + | == Créer des répertoires == |
− | You can create hierarchies of folders on the MicroPython board's filesystem with the '''mkdir''' command.
| + | Vous pouvez également créer une hiérarchie de répertoires sur le système de fichier de votre carte MicroPython à l'aide de la commande '''{{fname|mkdir}}''' . |
| | | |
− | For example to create a '''/foo''' folder under the root of a board run the following command:
| + | Par exemple, pour créer le répertoire '''/foo''' (répertoire "foo" dans la racine du système de fichier), vous pouvez saisir la commande suivante: |
| | | |
− | <nowiki>ampy --port /serial/port mkdir foo</nowiki> | + | <nowiki>ampy --port /port/serie mkdir foo</nowiki> |
| | | |
− | You can create directories inside directories too, for example to create a folder '''bar''' inside the foo folder above you can run:
| + | Vous pouvez créer un répertoire à l'intérieur de "foo", par exemple "'''bar'''" à l'aide de la commande suivante: |
| | | |
− | <nowiki>ampy --port /serial/port mkdir /foo/bar</nowiki> | + | <nowiki>ampy --port /port/serie mkdir /foo/bar</nowiki> |
| | | |
− | '''Make sure the parent foo directory exists before trying to create the bar subdirectory inside of it!''' The mkdir command won't create parent directories that don't exist. | + | '''Assurez vous que le répertoire parent "foo" existe bien avant de créer un sous répertoire!''' La commande {{fname|mkdir}} ne créera pas le répertoire parent si ce dernier n'existe pas. |
| | | |
| == Lister les répertoires == | | == Lister les répertoires == |