Python program as daemon?

James Harris james.harris.1 at googlemail.com
Mon Jul 28 09:10:04 EDT 2008


On 25 Jul, 20:05, sturlamolden <sturlamol... at yahoo.no> wrote:
> On Jul 25, 8:37 pm, Johny <pyt... at hope.cz> wrote:
>
> > Is it possible to run a Python program as daemon?
> > Thanks
>
> Here is an example on how to run a Python script as a Unix daemon:
>
> http://svn.plone.org/svn/collective/bda.daemon/trunk/bda/daemon/daemo...
>
> Basically it forks twice and redirects open file descriptors to /dev/
> null.
>
> On Windows, 'daemons' are called services. You can write Windows
> services in Python using the Pywin32 extension. See Mark Hammond's
> book for an explanation.

Also, on Windows, you can get good results using srvany

  http://support.microsoft.com/kb/137890

I've set this up to run Pyhton for a couple of scripts.




More information about the Python-list mailing list