Re: Simple threading example freezes IDLE?

2007-09-29 Thread James Matthews
idle doesn't work well with threads On 9/27/07, 7stud [EMAIL PROTECTED] wrote: On Sep 26, 5:01 pm, Sergio Correia [EMAIL PROTECTED] wrote: I'm using IDLE 1.2.1, Python 2.5.1, and Tk 8.4. Does anyone has any idea of why is this happening? Two mainloops == bad. IDLE == 1 mainloop.

Re: Simple threading example freezes IDLE?

2007-09-27 Thread 7stud
On Sep 26, 5:01 pm, Sergio Correia [EMAIL PROTECTED] wrote: I'm using IDLE 1.2.1, Python 2.5.1, and Tk 8.4. Does anyone has any idea of why is this happening? Two mainloops == bad. IDLE == 1 mainloop. your program == 1 mainloop. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple threading example freezes IDLE?

2007-09-26 Thread Sergio Correia
I think the -print- command, as used in IDLE, is not thread-safe. I was bitten by an issue like that today, and the problem ended up being the -print- command I used. On the cmd line, it works per-fect-ly.. but IDLE seems to be the culprit. A possible answer seems to be to write a wrapper for

Re: Simple threading example freezes IDLE?

2007-09-26 Thread Sergio Correia
I think I have pinpointed the error: When the -print- command fills the screen, IDLE crashes. That is, if i have 30 empty lines before I start to push the current screen upwards, when the last of those lines is used, and its time to push the screen upwards, IDLE crashes. I'm using IDLE 1.2.1,

Simple threading example freezes IDLE?

2007-09-19 Thread writser
hey all, For my study I'm writing a simple threaded webcrawler and I am trying to do this in python. But somehow, using threads causes IDLE to crash on Windows XP (with the latest python distribution 2.5.1). Even a simple example such as this: import thread, time def doSomething(): print

Simple Threading Example Doesn't Work (2.5.1)

2007-06-12 Thread Seun Osewa
Hello, I've tried to run several threading examples in Python 2.5.1 (with Stackless) For example: import threading theVar = 1 class MyThread ( threading.Thread ): def run ( self ): global theVar print 'This is thread ' + str ( theVar ) + ' speaking.'

Re: Simple Threading Example Doesn't Work (2.5.1)

2007-06-12 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Seun Osewa wrote: I've tried to run several threading examples in Python 2.5.1 (with Stackless) For example: import threading theVar = 1 class MyThread ( threading.Thread ): def run ( self ): global theVar print 'This

Re: Simple threading

2006-11-25 Thread Grant Edwards
On 2006-11-25, Gabriel Genellina [EMAIL PROTECTED] wrote: I'm just getting started on threading and was wondering why the following code does not work (i know globals is bad style - I'll eliminate them eventually). All I get is a blank cursor flashing. You've got your example already working.

Re: Simple threading

2006-11-25 Thread Aahz
In article [EMAIL PROTECTED], Grant Edwards [EMAIL PROTECTED] wrote: Re-binding a name is always an atomic operation. Modifying many mutable objects is atomic. You know this, but just to make clear: rebinding attributes of an object (which are also sometimes called names) is not necessarily an

Re: Simple threading

2006-11-25 Thread Fredrik Lundh
Grant Edwards wrote: That depends on the type of the global and how they're used. Re-binding a name is always an atomic operation. Modifying many mutable objects is atomic. footnote: for more on this topic, see this FAQ entry:

Re: Simple threading

2006-11-24 Thread jrpfinch
Thank you for your help - the application is proceeding well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple threading

2006-11-24 Thread Gabriel Genellina
At Thursday 23/11/2006 12:28, jrpfinch wrote: I'm just getting started on threading and was wondering why the following code does not work (i know globals is bad style - I'll eliminate them eventually). All I get is a blank cursor flashing. You've got your example already working. Globals

Simple threading

2006-11-23 Thread jrpfinch
I'm just getting started on threading and was wondering why the following code does not work (i know globals is bad style - I'll eliminate them eventually). All I get is a blank cursor flashing. Many thanks Jon import threading import sys import time global g_datum global g_rawfile global

Re: Simple threading

2006-11-23 Thread hg
jrpfinch wrote: I'm just getting started on threading and was wondering why the following code does not work (i know globals is bad style - I'll eliminate them eventually). All I get is a blank cursor flashing. Many thanks Jon import threading import sys import time global g_datum

Re: Simple threading

2006-11-23 Thread jrpfinch
many thanks - works perfectly now -- http://mail.python.org/mailman/listinfo/python-list