prog:python
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
prog:python [2019/12/04 18:25] – jbpuel | prog:python [2020/03/19 10:43] – [Quelques programmes] jbpuel | ||
---|---|---|---|
Ligne 6: | Ligne 6: | ||
IDE [[https:// | IDE [[https:// | ||
IDE [[https:// | IDE [[https:// | ||
+ | Distribution [[https:// | ||
Environnement pédagogique [[https:// | Environnement pédagogique [[https:// | ||
Environnement pédagogique [[https:// | Environnement pédagogique [[https:// | ||
Ligne 12: | Ligne 13: | ||
[[https:// | [[https:// | ||
- | [[https:// | + | [[https:// |
+ | [[https:// | ||
</ | </ | ||
===== Apprendre à programmer en Python ===== | ===== Apprendre à programmer en Python ===== | ||
- | ... quand on connait | + | [[prog: |
- | < | + | < |
===== Aides-mémoire et supports ===== | ===== Aides-mémoire et supports ===== | ||
Ligne 30: | Ligne 32: | ||
[[https:// | [[https:// | ||
+ | |||
+ | {{ : | ||
</ | </ | ||
Ligne 42: | Ligne 46: | ||
Cartopy, GeoPandas, ipyleaflet (info géo) | Cartopy, GeoPandas, ipyleaflet (info géo) | ||
- | Opencv, PIL ou Pillow | + | Opencv, PIL ou Pillow |
Kivy (interface graphique, multi plateforme) | Kivy (interface graphique, multi plateforme) | ||
Ligne 52: | Ligne 56: | ||
Python + arduino + OSC : [[https:// | Python + arduino + OSC : [[https:// | ||
- | ===== Quelques programmes | + | ===== Mises à jour avec Anaconda |
- | {{ : | + | < |
+ | conda update -n root conda | ||
+ | conda update --all | ||
+ | conda update anaconda-navigator | ||
+ | </ | ||
- | <code python> | + | <html> |
- | def nettoyage(phrase): | + | <!-- |
- | # Voir aussi unicodedata.normalize | + | ===== Utiliser la bibliothèque Turtle avec Jupyter Notebooks |
- | phrase = phrase.replace(" | + | |
- | phrase = phrase.replace("'", | + | |
- | phrase = phrase.replace(",", | + | |
- | phrase = phrase.replace(";", | + | |
- | phrase = phrase.replace(":", | + | |
- | phrase = phrase.replace(" | + | |
- | phrase = phrase.replace("?", | + | |
- | phrase = phrase.replace(" | + | |
- | phrase = phrase.replace(" | + | |
- | | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase | + | |
- | phrase = phrase.replace(" | + | |
- | phrase = phrase.replace(" | + | |
- | phrase = phrase.replace(" | + | |
- | phrase = phrase.replace(" | + | |
- | return phrase | + | |
- | ph = input(" | ||
- | ph = nettoyage(ph) | ||
- | i = 0 | + | Plusieurs modules à installer ! |
- | long = len(ph) | + | |
- | while i<long/2: | + | <code> |
- | if (ph[i] == ph[long-1-i]): | + | pip install ipyturtle |
- | pal = True | + | jupyter nbextension enable |
- | else: | + | |
- | pal = False | + | |
- | break | + | |
- | i=i+1 | + | |
- | + | ||
- | if pal: | + | |
- | print (" | + | |
- | else: | + | |
- | print ("Pas palindrome" | + | |
</ | </ | ||
- | <code python> | ||
- | # geektechstuff | ||
- | # Happy Birthday | ||
- | import time | + | Puis installer Node.js (qui comprend NPM) et : |
- | def happy_birthday(name): | + | < |
- | name = name.capitalize() | + | git clone https://github.com/ |
- | for x in range(2): | + | cd ipython-turtle-widget |
- | print(‘Happy Birthday to you.’) | + | pip install -e . |
- | time.sleep(1) | + | jupyter nbextension install --py --symlink --sys-prefix ipyturtle |
- | | + | jupyter nbextension enable --py --sys-prefix ipyturtle |
- | time.sleep(1) | + | |
- | print(‘Happy Birthday to you.’) | + | |
- | time.sleep(1) | + | |
- | for x in range(3): | + | |
- | print(‘Hip Hip Hooray!’) | + | |
- | + | ||
- | happy_birthday(‘jb’) | + | |
</ | </ | ||
+ | |||
+ | --!> | ||
+ | </ | ||
+ | ===== Quelques programmes ===== | ||
+ | |||
+ | Initiation au [[prog: | ||
+ | |||
+ | Variations autour du [[prog: | ||
+ | |||
+ | Travail avec des [[prog: | ||
+ | |||
+ | Expérimentations avec [[prog: |