Re: Thread Question
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Tue, 28 Feb 2006 20:24:18 -0000
On 2006-02-28, D <duncanm255@xxxxxxxxxxx> wrote:
I have a client application that I want (behind the scenes) to check
and make sure a remote host is up (i.e. by ping or TCP connect). I'm
assuming that, since I want this to go on "unknowingly" to the user,
that I would put this in a thread.
Probably.
My question is, how would I go about creating the thread?
Assuming foo is the function you want to start in a thread:
threading.Thread(target=foo).start()
I have seen examples that used classes, and other examples
that just called one thread start command - when should you
use one over another?
I'm not sure what you mean by "use classes" vs. "calling a
thread start command". My example above uses a class
(threading.Thread) to create a thread object, and then calls
its start method.
--
Grant Edwards grante Yow! HELLO, little boys!
at Gimme a MINT TULIP!! Let's
visi.com do the BOSSA NOVA!!
.
- Follow-Ups:
- Re: Thread Question
- From: Felipe Almeida Lessa
- Re: Thread Question
- From: D
- Re: Thread Question
- References:
- Thread Question
- From: D
- Thread Question
- Prev by Date: Make staticmethod objects callable?
- Next by Date: Re: comple list slices
- Previous by thread: Thread Question
- Next by thread: Re: Thread Question
- Index(es):
Relevant Pages
|