python time, time training loop, delay python time sleep timeout

preview_player
Показать описание
Measuring the duration of a machine learning training loop using Python time. Python script time out or sleep during API requests. Delay requests using Python scripts.
Рекомендации по теме
Комментарии
Автор

"""
Can you help
I want to draw a line slowly on screen using python tkinter.
time.sleep function does not help
The program waits for some time and draws
the entire line but not slowly.
My code is as below :
"""
import time
from tkinter import *

mw = Tk()
mw.minsize(width=600, height=600)
mc = Canvas(mw, width = 500, height = 500, bg = "yellow")
mc.place(x=50, y =0)

startpoint = 0

for i in range( 0, 500):
mc.create_line(startpoint, 100, i, 100)
startpoint = i
time.sleep(0.002)

mw.mainloop()

mukundathavale
visit shbcf.ru