running a script like a daemon

Alex Martelli aleaxit at
Sat Nov 8 18:14:44 CET 2003

ivan le magnifique wrote:

> I would like to know how to launch a script from the command line (like
> via telnet) with the ability to exit the command line without stopping the
> thead.
> Afterwards I would like to be able to retrieve the id of the thread to
> kill it.
> I know this is not really Python related since I have had the problem with
> Java already ( before my conversion to Python)... but, any idea would be
> appreciated.

To write the daemon's pid to a suitable file (you wrote thread, but that
makes no sense -- I assume you mean process...?!), see os.getpid.


More information about the Python-list mailing list