debuter_en_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 | ||
debuter_en_python [2022/01/15 20:00] – [Menu en mode texte python3] gerardadmin | debuter_en_python [2025/04/08 14:24] (Version actuelle) – [IDE Python3 en ligne] admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | |||
- | |||
===== Pourquoi apprendre à coder ===== | ===== Pourquoi apprendre à coder ===== | ||
Le codage, qu’est-ce que c’est ? Il s’agit simplement du langage de programmation informatique. Maîtriser cette nouvelle syntaxe permet de créer des actions et de commander aux machines. Un graphiste peut par exemple concevoir un site Internet, s’il sait coder il est également capable de lui donner vie sur la toile. | Le codage, qu’est-ce que c’est ? Il s’agit simplement du langage de programmation informatique. Maîtriser cette nouvelle syntaxe permet de créer des actions et de commander aux machines. Un graphiste peut par exemple concevoir un site Internet, s’il sait coder il est également capable de lui donner vie sur la toile. | ||
- | + | [[https:// | |
Savoir programmer permet ainsi de : | Savoir programmer permet ainsi de : | ||
Ligne 31: | Ligne 29: | ||
======== Le Python ======== | ======== Le Python ======== | ||
- | [[https:// | + | [[debuter_en_python: |
+ | |||
+ | [[https:// | ||
+ | ]] | ||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | < | ||
+ | |||
+ | [Apprendre python 3 en ligne](https:// | ||
+ | |||
+ | [Classes et objets en Python3 | ||
+ | |||
+ | </ | ||
[[https:// | [[https:// | ||
Ligne 37: | Ligne 51: | ||
[[https:// | [[https:// | ||
+ | [[http:// | ||
[[https:// | [[https:// | ||
Ligne 44: | Ligne 59: | ||
[[https:// | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | |||
+ | [[debuter_en_python: | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
===== Pygame ===== | ===== Pygame ===== | ||
[[https:// | [[https:// | ||
- | [[https://openclassrooms.com/fr/courses/ | + | [[https://papsdroidfr.github.io/dev/Pygame-bases/ | Apprendre Pygame FR]] |
[[http:// | [[http:// | ||
Ligne 76: | Ligne 103: | ||
C'est un logiciel libre sous licence GNU GPL1. | C'est un logiciel libre sous licence GNU GPL1. | ||
+ | |||
+ | |||
+ | [[https:// | ||
+ | |||
+ | === Visual Studio === | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
== Notepad++ == | == Notepad++ == | ||
[[https:// | [[https:// | ||
+ | |||
+ | == Thonny == | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | Facile à démarrer. [[https:// | ||
+ | |||
+ | == PyCharm == | ||
+ | |||
+ | [[start: | ||
+ | |||
+ | == Anaconda == | ||
+ | |||
+ | [[start: | ||
+ | |||
+ | == IDE Python3 en ligne == | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | == Transformer un programme Python main.py en main.exe == | ||
+ | |||
+ | [[start: | ||
===== Python le langage pour commencer===== | ===== Python le langage pour commencer===== | ||
- | * [[http://apprendre-python.com/page-apprendre-conditions-structures-conditionnelles-if-else-python-cours-debutant|"If else " en Python]] | + | * [[https://www.pierre-giraud.com/python-apprendre-programmer-cours/ |
- | * [[https:// | + | * [[https:// |
- | * [[https:// | + | * [[https:// |
- | * [[https:// | + | * [[https:// |
- | | + | |
| | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
===== Python et Minecraft ===== | ===== Python et Minecraft ===== | ||
Ligne 94: | Ligne 159: | ||
* [[https:// | * [[https:// | ||
- | === Doc Tuto - Livre === | + | === Doc Tuto - Livre === |
- | + | * {{ :apprendre_a_coder_grace_a_minecraft_ed1_v1-ch5.pdf | Minecraft :Interagir avec les circuits électroniques Ch5}} | |
- | + | * [[ https://www.micropython.fr/ |le langage Python et MicroPython ]] | |
- | | + | * [[https:// |
- | | + | * [[https:// |
- | | + | * [[http:// |
- | | + | |
- | | + | |
- | + | ||
- | ===== Les programmes du Tuto en Python | + | |
- | * [[http:// | ||
===== Videos ===== | ===== Videos ===== | ||
Ligne 125: | Ligne 185: | ||
===== Programmes d' | ===== Programmes d' | ||
+ | |||
+ | == Menu 1 en mode texte tres simple Python3 == | ||
+ | |||
+ | <code python py menu002.py> | ||
+ | menu_options = { | ||
+ | 1: ' | ||
+ | 2: ' | ||
+ | 3: ' | ||
+ | 4: ' | ||
+ | } | ||
+ | |||
+ | def print_menu(): | ||
+ | for key in menu_options.keys(): | ||
+ | print (key, ' | ||
+ | |||
+ | def option1(): | ||
+ | | ||
+ | |||
+ | def option2(): | ||
+ | | ||
+ | |||
+ | def option3(): | ||
+ | | ||
+ | |||
+ | if __name__==' | ||
+ | while(True): | ||
+ | print_menu() | ||
+ | option = '' | ||
+ | try: | ||
+ | option = int(input(' | ||
+ | except: | ||
+ | print(' | ||
+ | #Check what choice was entered and act accordingly | ||
+ | if option == 1: | ||
+ | | ||
+ | elif option == 2: | ||
+ | option2() | ||
+ | elif option == 3: | ||
+ | option3() | ||
+ | elif option == 4: | ||
+ | print(' | ||
+ | exit() | ||
+ | else: | ||
+ | print(' | ||
+ | </ | ||
== Menu en mode texte python3 == | == Menu en mode texte python3 == | ||
Ligne 135: | Ligne 240: | ||
# Import the necessary packages | # Import the necessary packages | ||
# pip install console-menu | # pip install console-menu | ||
+ | # Modifier par GL le 15/01/2022 | ||
############################# | ############################# | ||
Ligne 176: | Ligne 282: | ||
<code python py calc3.py> | <code python py calc3.py> | ||
## Programme de calculatrice tres simple pour demarrer en python | ## Programme de calculatrice tres simple pour demarrer en python | ||
- | ## GL 01/ | + | ## Modifier par GL 01/ |
############# | ############# | ||
Ligne 425: | Ligne 531: | ||
fen.mainloop() # Gestion de la fenêtre | fen.mainloop() # Gestion de la fenêtre | ||
</ | </ | ||
+ | |||
+ | |||
+ | == lire un fichier texte == | ||
+ | |||
+ | <code python py testfich001.py> | ||
+ | #! / | ||
+ | # coding: utf-8 | ||
+ | |||
+ | menu_options = { | ||
+ | 1: ' | ||
+ | 2: ' | ||
+ | 3: 'Aide -- 3', | ||
+ | 4: ' | ||
+ | } | ||
+ | |||
+ | def print_menu(): | ||
+ | for key in menu_options.keys(): | ||
+ | print (key, ' | ||
+ | |||
+ | def option1(): | ||
+ | | ||
+ | |||
+ | def option2(): | ||
+ | | ||
+ | |||
+ | def option3(): | ||
+ | f = open(' | ||
+ | data = f.read() | ||
+ | f.close | ||
+ | print(data) | ||
+ | |||
+ | if __name__==' | ||
+ | while(True): | ||
+ | print_menu() | ||
+ | option = '' | ||
+ | try: | ||
+ | option = int(input(' | ||
+ | except: | ||
+ | print(' | ||
+ | #Check what choice was entered and act accordingly | ||
+ | if option == 1: | ||
+ | | ||
+ | elif option == 2: | ||
+ | option2() | ||
+ | elif option == 3: | ||
+ | option3() | ||
+ | elif option == 4: | ||
+ | print(' | ||
+ | exit() | ||
+ | else: | ||
+ | print(' | ||
+ | |||
+ | </ | ||
+ | |||
+ | **Inserer le fichier texte " | ||
+ | |||
+ | <code txt aide001.txt> | ||
+ | Ceci est un fichier d aide à completer suivant les besoins : | ||
+ | |||
+ | une introduction | ||
+ | |||
+ | Python (prononcé /pi.tɔ̃/) est un langage de programmation interprété, | ||
+ | |||
+ | Il favorise la programmation impérative structurée, | ||
+ | |||
+ | Il est doté d'un typage dynamique fort, d'une gestion automatique de la mémoire par ramasse-miettes et d'un système de gestion d' | ||
+ | |||
+ | il est ainsi similaire à Perl, Ruby, Scheme, Smalltalk et Tcl. | ||
+ | |||
+ | Le langage Python est placé sous une licence libre proche de la licence BSD3 et fonctionne sur la plupart des plates-formes informatiques, | ||
+ | de Windows à Unix avec notamment GNU/Linux en passant par macOS, | ||
+ | des programmeurs en offrant des outils de haut niveau et une syntaxe simple à utiliser. | ||
+ | |||
+ | Il est également apprécié par certains pédagogues qui y trouvent un langage où la syntaxe, clairement séparée des mécanismes de bas niveau, permet une initiation aisée aux concepts de base de la programmation5. | ||
+ | </ | ||
+ | |||
+ | ===== Exemple Pygame ===== | ||
+ | [[start: | ||
+ | ======= MicroPython ======= | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | [[debuter_en_python: | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
+ | ======= CPython ======= | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
+ | ======= Calculatrices utilisant Python ======= | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
/home/chanteri/www/fablab37110/data/attic/debuter_en_python.1642273249.txt.gz · Dernière modification : (modification externe)