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édente | ||
prog:python [2019/12/04 18:27] – jbpuel | prog:python [2020/04/06 08:59] (Version actuelle) – supprimée jbpuel | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Programmation en Python ====== | ||
- | <WRAP download> | ||
- | ===== Environnements de programmation ===== | ||
- | |||
- | IDE [[https:// | ||
- | IDE [[https:// | ||
- | Environnement pédagogique [[https:// | ||
- | Environnement pédagogique [[https:// | ||
- | |||
- | ==== Editeurs de texte ==== | ||
- | |||
- | [[https:// | ||
- | [[https:// | ||
- | </ | ||
- | |||
- | ===== Apprendre à programmer en Python ===== | ||
- | |||
- | Support de cours de JBP | ||
- | |||
- | <WRAP important right 70%> | ||
- | ===== Aides-mémoire et supports ===== | ||
- | |||
- | On trouve des tonnes de tutos et de documents sur Python, ceux qui suivent sont des aide-mémoire très concis. | ||
- | |||
- | {{ : | ||
- | {{ : | ||
- | [[https:// | ||
- | [[http:// | ||
- | |||
- | [[https:// | ||
- | </ | ||
- | |||
- | <WRAP clear /> | ||
- | |||
- | ===== Bibliothèques utiles ===== | ||
- | |||
- | Turtle (graphiques simples avec la tortue) : {{ : | ||
- | |||
- | NumPy + SciPy, pandas, matplotlib (calcul scientifiques) | ||
- | |||
- | Cartopy, GeoPandas, ipyleaflet (info géo) | ||
- | |||
- | Opencv, PIL ou Pillow ([[prog: | ||
- | |||
- | Kivy (interface graphique, multi plateforme) | ||
- | |||
- | Theano (deep learning) | ||
- | |||
- | Outils de l' | ||
- | |||
- | Python + arduino + OSC : [[https:// | ||
- | |||
- | ===== Quelques programmes ===== | ||
- | |||
- | {{ : | ||
- | |||
- | <code python> | ||
- | def nettoyage(phrase): | ||
- | # Voir aussi unicodedata.normalize | ||
- | 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.lower() | ||
- | 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.replace(" | ||
- | phrase = phrase.replace(" | ||
- | phrase = phrase.replace(" | ||
- | phrase = phrase.replace(" | ||
- | return phrase | ||
- | |||
- | ph = input(" | ||
- | ph = nettoyage(ph) | ||
- | |||
- | i = 0 | ||
- | long = len(ph) | ||
- | |||
- | while i< | ||
- | if (ph[i] == ph[long-1-i]): | ||
- | pal = True | ||
- | else: | ||
- | pal = False | ||
- | break | ||
- | i=i+1 | ||
- | | ||
- | if pal: | ||
- | print (" | ||
- | else: | ||
- | print ("Pas palindrome" | ||
- | </ | ||
- | <code python> | ||
- | # geektechstuff | ||
- | # Happy Birthday | ||
- | |||
- | import time | ||
- | |||
- | def happy_birthday(name): | ||
- | name = name.capitalize() | ||
- | for x in range(2): | ||
- | print(‘Happy Birthday to you.’) | ||
- | time.sleep(1) | ||
- | print(‘Happy Birthday to you ’, | ||
- | time.sleep(1) | ||
- | print(‘Happy Birthday to you.’) | ||
- | time.sleep(1) | ||
- | for x in range(3): | ||
- | print(‘Hip Hip Hooray!’) | ||
- | |||
- | happy_birthday(‘jb’) | ||
- | </ |