[Tutor] Threads, ok to access parent script methods by passing 'self' ?

2012-06-05 Thread dave selby
Hi All, If a thread is started and 'self' is passed as a parameter, is it acceptable to access methods of the calling class via 'self.updateGrid()' etc from within the thread or does everything have to be done via wx.lib.pubsub and publisher calls ? Cheers Dave -- Please avoid sending

Re: [Tutor] Threads, ok to access parent script methods by passing 'self' ?

2012-06-05 Thread Walter Prins
Hi Dave, On 5 June 2012 11:13, dave selby dave6...@gmail.com wrote: Hi All, If a thread is started and 'self' is passed as a parameter, is it acceptable to access methods of the calling class via 'self.updateGrid()' etc from within the thread or does everything have to be done via

Re: [Tutor] Threads, ok to access parent script methods by passing 'self' ?

2012-06-05 Thread dave selby
On 5 June 2012 12:05, dave selby dave6...@gmail.com wrote: I was running the thread by instantiating a separate class but this will make the very neat CallAfter() difficult, is it OK to call a method in the main class as a thread in which case the CallAfter() should work OK ? Thanks Again

[Tutor] Threads and Signals

2011-12-20 Thread Andrew Heagle
Hi, I am testing out some stuff with threads and signals. This is just a prototype of how I want to incorporate it into my main script. I figured out how to catch signals for SIGUSR1 to output what all the thread children are working on. The problem I have is if in terminalA I run my script,

[Tutor] Threads very simple examle

2009-09-10 Thread Oleg Oltar
Hi! I have a question. I want to create simple load test for my web application. Consider the following script: while 1: urllib2.urlopen(www.example.com) How can I make it running in several threads? ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Threads very simple examle

2009-09-10 Thread Oleg Oltar
On Thu, Sep 10, 2009 at 12:43 PM, Alan Gauld alan.ga...@btinternet.comwrote: Oleg Oltar oltarase...@gmail.com wrote I want to create simple load test for my web application. Consider the following script: while 1: urllib2.urlopen(www.example.com) Just a small caveat. If you try a

Re: [Tutor] Threads very simple examle

2009-09-10 Thread Kent Johnson
On Thu, Sep 10, 2009 at 4:13 AM, Oleg Oltar oltarase...@gmail.com wrote: Hi! I have a question. I want to create simple load test for my web application. Consider the following script: while 1:     urllib2.urlopen(www.example.com) How can I make it running in several threads? Have you

Re: [Tutor] threads and webpy

2006-08-17 Thread emilia12
I just looked at web.py. It's not a webserver. It's a toolkit you use to write your own webserver. Why are you under the impression that it's a webserver? Did you just google for 'web server in Python' and find this? you are right, i mean that it is the core of the webserver If you're

Re: [Tutor] threads and webpy

2006-08-17 Thread anil maran
did u try os.spawnv()to spawn other unix commands[EMAIL PROTECTED] wrote: Hi!Hi ! I don't know what web.py is. Is it something you wrote?no, this is a simple webserver, (http://webpy.org/) You'll have to write multi-threaded code if you want it to run multiple threads :) (Unless, of course,

Re: [Tutor] threads and webpy

2006-08-17 Thread anil maran
hi likeyour post about how to make it listen on one ip and then on two ips isnt this general python, can you please explain how to go about this, this would be very usefulthanks then show us your code and we'll tell youhow to make it into a class that listens on a single IP and how tostart two

[Tutor] threads and webpy

2006-08-16 Thread emilia12
Hi! Hi ! I don't know what web.py is. Is it something you wrote? no, this is a simple webserver, (http://webpy.org/) You'll have to write multi-threaded code if you want it to run multiple threads :) (Unless, of course, Web.py supports threads?) i will ask the authors about this ...

Re: [Tutor] threads and webpy

2006-08-16 Thread Luke Paireepinart
yes - i will ask the webpy authors but i expected to fond out a way to start two (or more) scripts (web.py) in different threads from one puthon's scrypt. OR two pythons interpretators to execute the above scrypt ? Python is a programming language. It's not a question about whether it's

Re: [Tutor] : Threads?

2005-10-24 Thread Hugo González Monteverde
I have done scripts for decompressing MP3 in the past. I normally follow a fork() exec() subprocess scheme, and this helps me gain about 30% improvement. I'm not an expert, but I have read that CPU time will be better used by several processes than for just one, and while one process is

Re: [Tutor] : Threads?

2005-10-24 Thread Orri Ganel
Not sure what IIUC stands for, but I am, indeed, running windows. XP Home Edition, in fact, with Python 2.4.2 finalOn 10/24/05, Kent Johnson [EMAIL PROTECTED] wrote:Hugo González Monteverde wrote: I have done scripts for decompressing MP3 in the past. I normally follow a fork() exec() subprocess

Re: [Tutor] : Threads?

2005-10-24 Thread Kent Johnson
Orri Ganel wrote: Not sure what IIUC stands for, but I am, indeed, running windows. XP Home Edition, in fact, with Python 2.4.2 final If I Understand Correctly http://www.acronymfinder.com/ is helpful here. Kent ___ Tutor maillist -

Re: [Tutor] : Threads?

2005-10-22 Thread Orri Ganel
I knew what he meant, but since most albums have around 12 tracks, 4 tracks per thread gives you 3 threads. In any case, thanks for the catch on the loop. I'll let you know if it makes a difference.On 10/22/05, Kent Johnson [EMAIL PROTECTED] wrote: Alan means to use two or three threads

Re: [Tutor] : Threads?

2005-10-21 Thread Kent Johnson
Orri Ganel wrote: Hello all, I've been working on a program for a week or two now that will convert all the wav files in a folder to mp3s, filling the id3 tags with the correct information as collected from gracenote.com. This part works fine. However, the actual conversion to mp3

Re: [Tutor] : Threads?

2005-10-21 Thread Alan Gauld
in mind, I thought, why not try to use threads so all the conversions happen simultaneously? That way, the whole album will take between 30 and 50 seconds. One possible problem with this is that the activity is disk IO bound. In fact using too many threads could even slow the thing down

Re: [Tutor] : Threads?

2005-10-21 Thread Orri Ganel
I'll try doing 3 or 4 tracks per thread, then. Thanks for the advice.If you keep the thread count down to two or three you might get a noticable improvement but one thread per track, unless you havea lot of separate hard disk spindles to distribute the work willnot help much I suspect.Alan G. --

Re: [Tutor] threads

2005-02-25 Thread Bill Mill
Hi Hugo, snip I tried my hands at Stackless too... but still had problems implementing the concept. Can anyone guide me on how to spawn simultaneously( or pseudo simultaneously) running microthreads using stackless. Here is what i tried.. ef gencars(num,origin,dest,speed):

Re: [Tutor] threads

2005-02-25 Thread Mike Bell
If what you want is something that scales up, then you're attacking the Wrong Problem. Rather than focus on getting your thread overhead as small as possible in order to support as much real-time concurrency as you can, you should (as has been suggested) try to get simulation-time concurrency

Re: [Tutor] threads

2005-02-25 Thread Shitiz Bansal
I have run into a problem again. I thought about simulation time concurrency and figured an inherent problem with the approach. The main objective of my project is to simulate traffic behavious under congested conditions.Hence I was using semaphores to lock the areas already occupied by the

Re: [Tutor] threads

2005-02-25 Thread R. Alan Monroe
Remember that I am generating cars even while the simulation is running, hence calculating this HCF at the beginning is not going to work. Any comments? This won't help you much in writing your program, but you might find it interesting and vaguely similar to what you're doing:

[Tutor] threads

2005-02-23 Thread Shitiz Bansal
Hi, I am trying to build a traffic network simulator using python, for my degree project. I need to run at least 5-6000 cars simultaneously.I wanted to run each car in a separate thread. However , after about 400 threads i am unable to create new threads. Here's the code: cars=range(1000) for

Re: [Tutor] threads

2005-02-23 Thread Kent Johnson
Shitiz Bansal wrote: Hi, I am trying to build a traffic network simulator using python, for my degree project. I need to run at least 5-6000 cars simultaneously.I wanted to run each car in a separate thread. However , after about 400 threads i am unable to create new threads. There does seem to be

Re: [Tutor] threads

2005-02-23 Thread Shitiz Bansal
Hi, Googling for my problem i found the following page: http://gnosis.cx/publish/programming/charming_python_b7.html It doesnt make much sense to me.It seems that the author is implementing a series of routines rather than running them sumultaneously as threads are supposed to do.Am i missing

Fwd: [Tutor] threads

2005-02-23 Thread Max Noel
Some day I'm actually going to learn how to hit the Reply All button. I swear. Begin forwarded message: From: Max Noel [EMAIL PROTECTED] Date: February 23, 2005 18:42:37 GMT To: Shitiz Bansal [EMAIL PROTECTED] Subject: Re: [Tutor] threads On Feb 23, 2005, at 17:50, Shitiz Bansal wrote: Hi, I am

Re: [Tutor] threads

2005-02-23 Thread Kent Johnson
Shitiz Bansal wrote: Hi, Googling for my problem i found the following page: http://gnosis.cx/publish/programming/charming_python_b7.html It doesnt make much sense to me.It seems that the author is implementing a series of routines rather than running them sumultaneously as threads are supposed

Re: [Tutor] threads

2005-02-23 Thread Danny Yoo
On Wed, 23 Feb 2005, Shitiz Bansal wrote: I am trying to build a traffic network simulator using python, for my degree project. I need to run at least 5-6000 cars simultaneously. I wanted to run each car in a separate thread. However , after about 400 threads i am unable to create new

Re: [Tutor] threads

2005-02-23 Thread guillermo . fernandez . castellanos
Nothing to do, but did you think about SimPy? http://simpy.sourceforge.net/ It may make your life much simpler. G On Wed, 23 Feb 2005 11:32:12 -0800 (PST), Danny Yoo [EMAIL PROTECTED] wrote: On Wed, 23 Feb 2005, Shitiz Bansal wrote: I am trying to build a traffic network simulator using