How do I implement a simple cross platform Python daemon?

前端 未结 5 1578
执笔经年
执笔经年 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:50

    In Windows it's called a "service" and you could implement it pretty easily e.g. with the win32serviceutil module, part of pywin32. Unfortunately the two "mental models" -- service vs daemon -- are very different in detail, even though they serve similar purposes, and I know of no Python facade that tries to unify them into a single framework.

提交回复
热议问题