Yes, I'm just looking for a way to stop a longer function (within a loop) with a press of a key. In my example the function is repeated as long as the program is running and as long as I don't press 's' key to stop it, but even then the function will run till completion before stopping the repetition.
Just to give an idea what the marketloop() is currently set to do, is that it will click though series of buttons to navigate in a game screen, so it will take a moment to finish with all the small sleeps in between the clicks. I want that to stop instantly when I press the button and not wait until it finish.
Just to give an idea what the marketloop() is currently set to do, is that it will click though series of buttons to navigate in a game screen, so it will take a moment to finish with all the small sleeps in between the clicks. I want that to stop instantly when I press the button and not wait until it finish.