I am running a Python script that uses the requests
library to get data from a service.
The script takes a while to finish and I am currently running it locally on my Windows 7 laptop. If I lock my screen and leave, will the script continue to run (for ~3 hours) without Windows disconnecting from the internet or halting any processes? The power settings are already set up to keep the laptop from sleeping.
If it will eventually halt anything, how do I keep this from happening? Thanks.
You don't need to worry about the screen locking or turning off as these wont affect running processes. However, if your system is set to sleep after a set amount of time you may need to change this to Never. Keep in mind there are separate settings depending on whether or not the system is plugged in.
Challenge: Run a piece of Python code forever—until it is forcefully interrupted by the user. Solution: use a while loop with a Boolean expression that always evaluates to True . Examples: have a look at the following variants of an infinite while loop.
Show activity on this post. Yes, terminal processes like a python script will stop execution when the machine goes into idle sleep.
Yes, when the computer is in lock mode the program and you run any programs it will run, if it is in sleep mode, program will stop running.
As long as the computer doesn't get put to sleep, your process should continue to run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With