Voila les bonnes lignes de code et j'ai toujours restart sans apparitions de mon base
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| from Tkinter import *
coord=[(20,30),(120,30),(220,30),(70,80),(170,80)]
coul = ["red","yellow","blue","green","black"]
base = Tk()
can =Canvas(base,width =200,height = 200,bg = "white")
can.pack()
bou = Button(base,text = "quitter",command = base.quit)
bou.pack(side = RIGHT)
i=0
while i<5:
x1,y1=coord[i][0],coord[i][1]
can.create_oval(x1,y1,x1+100,y1+100,width = 2,outline = couleur[i])
i=i+1
base.mainloop() |
derniere modif(je crois) couleur n'existe pas
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
from Tkinter import *
coord=[(20,30),(120,30),(220,30),(70,80),(170,80)]
coul = ["red","yellow","blue","green","black"]
base = Tk()
can =Canvas(base,width =200,height = 200,bg = "white")
can.pack()
bou = Button(base,text = "quitter",command = base.quit)
bou.pack(side = RIGHT)
i=0
while i<5:
x1,y1=coord[i][0],coord[i][1]
can.create_oval(x1,y1,x1+100,y1+100,width = 2,outline = coul[i])
i=i+1
base.mainloop() |