This is an archive copy of wikilivres.ca as of 18 February 2017 (from the WikiTeam dump). The original site is closed.
Page:Swinnen - Apprendre Python, 2010.djvu/130: Difference between revisions
imported>Zephyrus |
imported>Zephyrus o |
||
| (One intermediate revision by the same user not shown) | |||
| Page body (to be transcluded): | Page body (to be transcluded): | ||
| Line 5: | Line 5: | ||
[[Image:Python 8 14.png|350px|right|Figure 16]] | [[Image:Python 8 14.png|350px|right|Figure 16]] | ||
<div style="float:center; margin-left:auto; margin-right:auto; padding:0%; font-size:85%; width: | <div style="float:center; margin-left:auto; margin-right:auto; padding:0%; font-size:85%; width:750px; background:whitesmoke; color:darkblue;"> | ||
{|style="background:whitesmoke; color:darkblue; padding:0%;" | {|style="background:whitesmoke; color:darkblue; padding:0%;" | ||
|width=" | |width="95%;"| | ||
<poem> | <poem> | ||
{{br0}}from tkinter import * | {{br0}}from tkinter import * | ||
| Line 41: | Line 41: | ||
flag =1 | flag =1 | ||
move() | move() | ||
</poem> | |||
#========== Programme principal ============= | |} | ||
</div> | |||
<div style="float:center; margin-left:auto; margin-right:auto; padding:0%; font-size:85%; width:750px; background:whitesmoke; color:darkblue;"> | |||
{|style="background:whitesmoke; color:darkblue; padding:0%;" | |||
|width="95%;"| | |||
<poem> | |||
{{br0}} | |||
<nowiki>#</nowiki>========== Programme principal ============= | |||
# les variables suivantes seront utilisées de manière globale : | # les variables suivantes seront utilisées de manière globale : | ||
Latest revision as of 19:50, 23 April 2012
Pour conclure cette première prise de contact avec l’interface graphique tkinter, voici un dernier exemple d’animation, qui fonctionne cette fois de manière autonome dès qu’on l’a mise en marche.

|
|
|
x1, y1 = 10, 10 # coordonnées initiales
fen1 = Tk()
can1 = Canvas(fen1,bg='dark grey',height=250, width=250) |