How do I implement a simple cross platform Python daemon?

前端 未结 5 1581
执笔经年
执笔经年 2021-01-31 10:27

I would like to have my Python program run in the background as a daemon, on either Windows or Unix. I see that the python-daemon package is for Unix only; is there an alternati

5条回答
  •  一整个雨季
    2021-01-31 10:30

    The reason it's unix only is that daemons are a Unix specific concept i.e a background process initiated by the os and usually running as a child of the root PID .
    Windows has no direct equivalent of a unix daemon, the closest I can think of is a Windows Service. There's a program called pythonservice.exe for windows . Not sure if it's supported on all versions of python though

提交回复
热议问题