B
B
BegChel2021-07-27 19:31:49
Python
BegChel, 2021-07-27 19:31:49

Timer per action in Python, how to do?

After pressing the button, the timer loop should work so that every 10 ticks the progress bar is filled with 5%, how to do it?

def clicked(): #here is
the timer described above

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
K A, 2021-07-27
@russrage

Look at here

V
Vindicar, 2021-07-28
@Vindicar

You can use window.after() . It guarantees a call of the function specified by you approximately in the set number of milliseconds. Inside the function, you check if another call is needed, and if you need it, you schedule it by calling after() again.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question