[EMAIL PROTECTED] wrote:

> On Feb 21, 9:33 am, Eirikur Hallgrimsson <[EMAIL PROTECTED]>
> wrote:
>> Sakagami Hiroki wrote:
>> > What is the easiest way to create a daemon process in Python?
> 
> I've found it even easier to use the built in threading modules:
> 
> import time
> 
> t1 = time.time()
> print "t_poc.py called at", t1
> 
> import threading
> 
> def im_a_thread():
>     time.sleep(10)
>     print "This is your thread speaking at", time.time()
> 
> thread = threading.Thread(target=im_a_thread)
> thread.setDaemon(True)
> thread.start()
> t2 = time.time()
> print "Time elapsed in main thread:", t2 - t1
> 
> 
> Of course, your mileage may vary.

That's not a daemon process (which are used to execute 'background services'
in UNIX environments).

-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to