Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | |||
teaching:progappchim:codes_presentation [2016/02/17 12:07] – villersd | teaching:progappchim:codes_presentation [2021/01/28 17:58] (Version actuelle) – villersd | ||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
//Cf.// la [[https:// | //Cf.// la [[https:// | ||
- | <sxh python; title : turtle-01.py> | + | <code python turtle-01.py> |
# | # | ||
# -*- coding: UTF-8 -*- | # -*- coding: UTF-8 -*- | ||
Ligne 38: | Ligne 38: | ||
time.sleep(10) | time.sleep(10) | ||
- | </sxh> | + | </code> |
===== Tkinter ===== | ===== Tkinter ===== | ||
- | En Python 2. Pour Python 3, utiliser "from tkinter import *" et print() ! | ||
//Cf.// la [[https:// | //Cf.// la [[https:// | ||
- | <sxh python; title : tkinter-simple-entry.py> | + | <code python tkinter-simple-entry.py> |
# | # | ||
# -*- coding: UTF-8 -*- | # -*- coding: UTF-8 -*- | ||
Ligne 51: | Ligne 50: | ||
# lecture de 2 masses par une fenêtre tk | # lecture de 2 masses par une fenêtre tk | ||
- | from Tkinter | + | from tkinter |
fen01 = Tk() | fen01 = Tk() | ||
Ligne 72: | Ligne 71: | ||
fen01.destroy() | fen01.destroy() | ||
- | print ' | + | print(' |
- | </sxh> | + | </code> |
==== Canvas Tkinter : rebond d'une balle ==== | ==== Canvas Tkinter : rebond d'une balle ==== | ||
- | <sxh python; title : anima_auto_rebond.py> | + | <code python anima_auto_rebond.py> |
#! / | #! / | ||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||
Ligne 84: | Ligne 83: | ||
# Petit exercice utilisant la librairie graphique Tkinter | # Petit exercice utilisant la librairie graphique Tkinter | ||
- | from Tkinter | + | from tkinter |
# définition des gestionnaires | # définition des gestionnaires | ||
Ligne 137: | Ligne 136: | ||
fen1.mainloop() | fen1.mainloop() | ||
fen1.destroy() | fen1.destroy() | ||
- | </sxh> | + | </code> |
==== DemoTkinter ==== | ==== DemoTkinter ==== | ||
Ligne 144: | Ligne 143: | ||
===== Matplotlib - pylab ===== | ===== Matplotlib - pylab ===== | ||
- | <sxh python; title : simple_fonction.py> | + | <code python simple_fonction.py> |
# | # | ||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||
Ligne 164: | Ligne 163: | ||
show() | show() | ||
- | </sxh> | + | </code> |