简体   繁体   中英

turtle.ontimer() equivalent for tkinter

I am writing a program that requires the tkinter canvas to update graphics. In its previous form it was written in turtle. The turtle function to update the canvas is turtle.ontimer() Is there a tkinter equivalent?

You can use after method:

For example:

root = Tk()

...

root.after(2000, callback) # call `callback` function in 2000 ms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM