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 ):
def run
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 like this:
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 =
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 .
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 time
t =
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
suspect that it
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 ):
def run
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 time
t
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
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 ):
10 matches
Mail list logo