Python 3.6.3: turtle库中有没有和root.after做同样事情的方法?

Python 3.6.3: Is there a method in the turtle library that does the same thing as root.after?

在 python 中,我正在制作一个 turtle 程序并且我需要循环一个函数,我不会使用 def n():#code; time.sleep(time); n() 因为我相信它很快就会引发 RecursionError足够了,由于语法。

我很快了解到 tkinterroot.after 语法。

但是,我正在寻找 turtle 库的相同语法。我已经在网上查了好几次,但到目前为止都没有运气。

海龟库中有没有满足我需求的函数?

怎么样?

turtle.ontimer(fun, t=0)

参数: fun——一个没有参数的函数 t – 一个数字 >= 0

https://docs.python.org/2/library/turtle.html#turtle.ontimer