Différences entre versions de « ENG-CANSAT-PICO-LOG »
Sauter à la navigation
Sauter à la recherche
(Page créée avec « {{ENG-CANSAT-PICO-NAV}} {{traduction}} {{ENG-CANSAT-PICO-TRAILER}} ») |
|||
Ligne 2 : | Ligne 2 : | ||
{{traduction}} | {{traduction}} | ||
+ | == MicroPython File System == | ||
+ | MicroPython board does fits a internal file system. This means that Python language on a MicroPython board can also manage files! | ||
+ | |||
+ | On a MicroPython board, you can manage files and directories. Creating them, deleting them, adding data to them, etc. | ||
+ | |||
+ | As any good implementation of Python, MicroPython can manage text files and binary files. | ||
+ | |||
+ | == Data Logging on MicroPython == | ||
+ | Doing data logging with MicroPython is quite easy. You just open a file and write data into it like you will do with any Python code. | ||
+ | |||
+ | === Writing data to text file === | ||
+ | The following example adds lines to the 'file.txt'. The {{fname|with}} statement will automatically close the file when the code gets out of the {{fname|with}} scope. | ||
+ | |||
+ | <syntaxhighlight lang="python"> | ||
+ | xxx | ||
+ | </syntaxhighlight> | ||
{{ENG-CANSAT-PICO-TRAILER}} | {{ENG-CANSAT-PICO-TRAILER}} |
Version du 6 mars 2022 à 23:39
En cours de traduction/élaboration. |
MicroPython File System
MicroPython board does fits a internal file system. This means that Python language on a MicroPython board can also manage files!
On a MicroPython board, you can manage files and directories. Creating them, deleting them, adding data to them, etc.
As any good implementation of Python, MicroPython can manage text files and binary files.
Data Logging on MicroPython
Doing data logging with MicroPython is quite easy. You just open a file and write data into it like you will do with any Python code.
Writing data to text file
The following example adds lines to the 'file.txt'. The with statement will automatically close the file when the code gets out of the with scope.
xxx
Written by Meurisse D. for MCHobby