Basically the title, i have a small python script (python 3.9, Windows 10) that i would like to keep running in the background. It is currently listening for keyboard hotkeys and acting like a macro engine. I want it to stay idle, since i use the keyboard module so i doesnt need to call anything, just wait.
I tried a while loop with either pass
or sleep
in it, but both have downsides, the one with pass
using a lot of cpu ressources, and the one with sleep
being very unreliable.
Is there any pretty/good practice way of doing this ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…