Outils pour utilisateurs

Outils du site


lancer_correctement_python

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
Prochaine révisionLes deux révisions suivantes
lancer_correctement_python [2020/03/26 13:07] – [Le bon sens] sergelancer_correctement_python [2021/02/24 17:54] – [Ce qu'il faut retenir par cœur] serge
Ligne 1: Ligne 1:
 ====== Lancer correctement python ====== ====== Lancer correctement python ======
  
 +<WRAP center round box 60% centeralign>
 +**[[toutes_les_pages_sur_python|Toutes les pages sur Python]] sans les pages sur {{tagpage>kivy|Kivy}}**\\
 +**[[http://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fressources.labomedia.org%2Flancer_correctement_python|English Version]]**
 +</WRAP>
  
 <WRAP center round info centeralign 60%> <WRAP center round info centeralign 60%>
Ligne 26: Ligne 30:
   * **[[https://docs.python.org/fr/3/tutorial/index.html|Le tutoriel Python]]** de la fondation Python fr.   * **[[https://docs.python.org/fr/3/tutorial/index.html|Le tutoriel Python]]** de la fondation Python fr.
 =====Ce qu'il faut retenir par cœur===== =====Ce qu'il faut retenir par cœur=====
 +
 +====Installer un package====
  
   python3.7 -m pip install black --user    python3.7 -m pip install black --user 
-  python3.7 -m black mon_fichier.py+   
 +Pour lancer un script: 
 + 
 +  python3.7 -m mon_fichier.py 
 + 
 +====Mettre à jour pip==== 
 +   
 +  python3.7 -m pip install --upgrade pip 
 +   
 +    WARNING: The scripts pip, pip3 and pip3.7 are installed in '/home/toto/.local/bin' which is not on PATH. 
 +  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. 
 +   
 +Ajouter au fichier ~/.bashrc
  
 +  # Pour pip, pip3 and pip3.7
 +  export PYTHONPATH="${PYTHONPATH}:/home/toto/.local/bin"
 +  
 =====VirtualEnv===== =====VirtualEnv=====