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 Prochaine révision | Révision précédente Prochaine révisionLes deux révisions suivantes | ||
teaching:progappchim:tkinter_gui_simple [2017/05/04 12:02] – villersd | teaching:progappchim:tkinter_gui_simple [2021/03/09 09:05] – villersd | ||
---|---|---|---|
Ligne 15: | Ligne 15: | ||
<note warning> | <note warning> | ||
+ | |||
+ | <note warning> | ||
+ | |||
+ | Vérifier le comportement en utilisant Idle et la version de base de Python ! | ||
+ | </ | ||
===== Une étiquette (Label) affichant " | ===== Une étiquette (Label) affichant " | ||
Ligne 355: | Ligne 360: | ||
===== Insérer une image (photoimage) ===== | ===== Insérer une image (photoimage) ===== | ||
+ | |||
+ | <note tip>Avec Spyder, sous Anaconda, l' | ||
+ | |||
+ | Solution : choisir dans les préférences de spyder la partie " | ||
+ | |||
+ | Autre solution : menu " | ||
+ | </ | ||
+ | |||
Télécharger l' | Télécharger l' | ||
<code python image_import-01.py> | <code python image_import-01.py> | ||
Ligne 361: | Ligne 374: | ||
""" | """ | ||
insert a PNG image into a python tkinter window | insert a PNG image into a python tkinter window | ||
- | image png : https://en.wikipedia.org/wiki/File:Lenna.png | + | image png : https://upload.wikimedia.org/wikipedia/commons/ |
- | cf. https://en.wikipedia.org/wiki/Lenna | + | cf. https://commons.wikimedia.org/wiki/File: |
""" | """ | ||
Ligne 368: | Ligne 381: | ||
root = tk.Tk() | root = tk.Tk() | ||
- | img = tk.PhotoImage(file = "Lenna.png") | + | img = tk.PhotoImage(file = "mandrill.png") |
label = tk.Label(root, | label = tk.Label(root, | ||
# | # | ||
Ligne 374: | Ligne 387: | ||
root.mainloop() | root.mainloop() | ||
</ | </ | ||
+ | |||
+ | * Image utilisée historiquement fréquemment en traitement d' | ||
+ | * [[https:// | ||
+ | * Base d' | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | |||
+ | {{ https:// | ||
===== Autres composants logiciels (widgets) de Tkinter ===== | ===== Autres composants logiciels (widgets) de Tkinter ===== |