Background Running Python Script continues to stop

I created a python.pyw script that I want to run against the background of my computer.
I am currently launching it by placing it in the Startup folder of my Windows 7 computer, which should start it at startup.

The problem is that the script, for some reason, stops working at some point. I think it just stops when my computer goes into sleep mode and does not start again after that.

Is there a more β€œcorrect” way to start a background task that should not die every time the computer sleeps?

+3
source share
1 answer

If you really need to constantly work the background process, you should explore the possibility of creating a service.

pywin32 helps in creating NT services with python

If you're in .NET, you can try IronPython , but I don't know if this is easier.

0
source

Source: https://habr.com/ru/post/1768696/


All Articles