简体   繁体   English

在屏幕锁定后保持Python脚本运行(Win.7)

[英]Keep Python script running after screen lock (Win. 7)

I am running a Python script that uses the requests library to get data from a service. 我正在运行一个Python脚本,它使用requests库从服务中获取数据。

The script takes a while to finish and I am currently running it locally on my Windows 7 laptop. 该脚本需要一段时间才能完成,我目前正在Windows 7笔记本电脑上本地运行它。 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? 如果我锁定我的屏幕并离开,脚本是否会继续运行(约3小时),而Windows无法断开互联网连接或暂停任何进程? 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. 谢谢。

只要计算机无法进入休眠状态,您的进程就应该继续运行。

Check "Power Options" in the Control panel. 检查“控制”面板中的“电源选项”。 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. 请记住,根据系统是否已插入,有单独的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM