Stop a infinite loop in Pythonw (without console)

99 views Asked by At

I have written a code in Python to open a website in infinite loop, also I made it to Pythonw (without console). I want to stop it without powering off my computer, is there any way to do it?

1

There are 1 answers

0
Gustav Rasmussen On

From your script, you can use the sys module, for example with the

sys.exit()

command. You could also use exponential back-off, by adding an increasing sleep-step within a try block, if you need to retry opening the URL.