Найти - Пользователи
Полная версия: Tk create_line
Начало » GUI » Tk create_line
1
mr.pihto
что нужно сделать с этим кодом чтоб линии рисовались не по нажатию кнопки а сами с интервалом в 1 секунду?
from Tkinter import *
from random import *
import time
tk = Tk()
w = Canvas(tk, width=200, height=200)
def line(event):
x1=0
x2=0
x3 = randint(0,200)
x4 = randint(0,200)
w.create_line(x1, x2, x3, x4)
w.bind("<Button-1>",line)
w.pack()
mainloop()
Griffon
threading.Timer(1.0, myfunc) c самостоятельным перезапуском
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB