You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
818 B
28 lines
818 B
import tkinter as tk
|
|
|
|
def allumer ():
|
|
rond = canva.create_oval(310,130,200,300,fill='yellow')
|
|
rectangle=rectangle =canva.create_rectangle
|
|
(230,300,280,380, fill='black')
|
|
canva=tk.Canvas(fenetre, width=500, height=500, bg='white')
|
|
def eteindre ():
|
|
rond = canva.create_oval(310,130,200,300,fill='black',
|
|
outline='white')
|
|
|
|
fenetre = tk.Tk()
|
|
fenetre.title('lampe')
|
|
canva=tk.Canvas(fenetre, width=500, height=500, bg='black')
|
|
canva.grid(column=1, columnspan=2)
|
|
rectangle =canva.create_rectangle(230,300,280,380, fill='white')
|
|
rond = canva.create_oval(310,130,200,300,outline='white')
|
|
tk.Button(text ='allumer',command=allumer).grid(column=1,row=3, padx=5,pady=5)
|
|
tk.Button(text ='eteindre',command=eteindre).grid(column=2,row=3, padx=5,pady=5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fenetre.mainloop()
|