How do you create a daemon in Python?

后端 未结 16 1707
轻奢々
轻奢々 2020-11-22 01:55

Searching on Google reveals x2 code snippets. The first result is to this code recipe which has a lot of documentation and explanation, along with some useful discussion und

16条回答
  •  梦毁少年i
    2020-11-22 02:37

    Current solution

    A reference implementation of PEP 3143 (Standard daemon process library) is now available as python-daemon.

    Historical answer

    Sander Marechal's code sample is superior to the original, which was originally posted in 2004. I once contributed a daemonizer for Pyro, but would probably use Sander's code if I had to do it over.

提交回复
热议问题