python - How to run tkinker while I have a different loop running -


this question has answer here:

so in program i'm using tkinter handle key presses program runs in tick loop , i've found out programs tick loop , tkinters main loop clashing eatch other. there way fix this? dose tkinter have function dose single loop call on eatch of ticks? if not recommend replacing tkinter handle key pressing?

i've dealt same issue :)

you can achieve want using tkinter's after() , after_idle() functions.

for example, loop function can that:

def loop(self):     #  whatever tick loop needs to     self.cyclesid = self.after_idle(self.loop) 

you can call once , called again every iteration of tkinter's mainloop().


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -