Différences entre versions de « FEATHER-CHARGER-MODULE »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 2 : Ligne 2 :
  
 
{{traduction}}
 
{{traduction}}
 +
{{ADFImage|FEATHER-CHARGER-MODULE-IMPORT.png}}
 +
 
Extending your scripts by including code from other files is a great way to simplify and structure programs.  Instead of constantly reinventing the wheel for mundane tasks you can put code for them in a Python module or package once and then reuse that code in other scripts.  This way you can focus on what's important for your project instead of reimplementing trivial details.  Even better by creating modules and packages you can share your code with others so they can benefit from it too!
 
Extending your scripts by including code from other files is a great way to simplify and structure programs.  Instead of constantly reinventing the wheel for mundane tasks you can put code for them in a Python module or package once and then reuse that code in other scripts.  This way you can focus on what's important for your project instead of reimplementing trivial details.  Even better by creating modules and packages you can share your code with others so they can benefit from it too!
  

Version du 10 novembre 2016 à 12:19


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

Extending your scripts by including code from other files is a great way to simplify and structure programs. Instead of constantly reinventing the wheel for mundane tasks you can put code for them in a Python module or package once and then reuse that code in other scripts. This way you can focus on what's important for your project instead of reimplementing trivial details. Even better by creating modules and packages you can share your code with others so they can benefit from it too!

With MicroPython you can import code in two ways. One easy way is from Python files on a board's filesystem just like you would import Python modules & packages on the desktop. A second way is with 'frozen modules' that are baked-in to a build of MicroPython's firmware and reduce the memory usage of a module vs. importing its raw Python source. This guide explores how to import modules & packages as both raw Python source files and frozen modules for maximum efficiency.

Before you get started you'll want to have a board running MicroPython and be familiar with its basic usage like the serial REPL. In addition for frozen modules you'll need to be familiar with building the MicroPython firmware for your board which is somewhat of an advanced topic. Check out the following guides:


Source: MicroPython Basics: Loading Modules
Créé par Tony DiCola pour AdaFruit Industries.

Traduit par Meurisse D. pour MCHobby

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com