On Apr 24, 12:32 pm, sophie_newbie <[EMAIL PROTECTED]> wrote:
> On Apr 22, 3:10 pm,sophie_newbie<[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, I'm trying to write a piece of code that spawns a thread and
> > prints dots every half second until the thread spawned is finished.
> > Code is
> > something lik
On Apr 22, 3:10 pm, sophie_newbie <[EMAIL PROTECTED]> wrote:
> Hi, I'm trying to write a piece of code that spawns a thread and
> prints dots every half second until the thread spawned is finished.
> Code is
> something like this:
>
> import threading
> class MyThread ( threading.Thread ):
>
Larry Bates schrieb:
sophie_newbie wrote:
On Apr 22, 4:41 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
On Tue, 22 Apr 2008 07:10:07 -0700 (PDT)
sophie_newbie<[EMAIL PROTECTED]> wrote:
import threading
class MyThread ( threading.Thread ):
def run ( self ):
myLong
I think that there are two things that you need to wrap your head
around before understanding what is happening here. First, threads are
NOT pre-emptive. Unless your thread gives up the processor it will run
forever. The sleep call is one way to give up the processor.
That is not correct, at
sophie_newbie wrote:
On Apr 22, 4:41 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
On Tue, 22 Apr 2008 07:10:07 -0700 (PDT)
sophie_newbie<[EMAIL PROTECTED]> wrote:
import threading
class MyThread ( threading.Thread ):
def run ( self ):
myLongCommand()...
import ti
En Tue, 22 Apr 2008 13:32:38 -0300, sophie_newbie <[EMAIL PROTECTED]> escribió:
> On Apr 22, 4:41 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
>> On Tue, 22 Apr 2008 07:10:07 -0700 (PDT)
>> sophie_newbie<[EMAIL PROTECTED]> wrote:
>> > import threading
>> > class MyThread ( threading.Thread ):
On Tue, 22 Apr 2008 09:32:38 -0700 (PDT)
sophie_newbie <[EMAIL PROTECTED]> wrote:
> On Apr 22, 4:41 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
> > We know that your main routine gives up the processor but without a
> > full definition of MyThread how do we know that it ever does? I
> > susp
On Apr 22, 4:41 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
> On Tue, 22 Apr 2008 07:10:07 -0700 (PDT)
>
>
>
> sophie_newbie<[EMAIL PROTECTED]> wrote:
> > import threading
> > class MyThread ( threading.Thread ):
> > def run ( self ):
> > myLongCommand()...
>
> > impor
On Tue, 22 Apr 2008 07:10:07 -0700 (PDT)
sophie_newbie <[EMAIL PROTECTED]> wrote:
> import threading
> class MyThread ( threading.Thread ):
> def run ( self ):
> myLongCommand()...
>
> import time
>
> t = MyThread()
> t.start()
>
> while t.isAlive():
> print "."
>
Hi, I'm trying to write a piece of code that spawns a thread and
prints dots every half second until the thread spawned is finished.
Code is
something like this:
import threading
class MyThread ( threading.Thread ):
def run ( self ):
myLongCommand()...
import time
t = MyT
10 matches
Mail list logo