[SOLVED] Re: Threading and Windows.

Jorge Godoy godoy at metalab.unc.edu
Tue Sep 30 09:54:57 EDT 2003


Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:

> Jorge Godoy fed this fish to the penguins on Monday 29 September 2003 
> 07:31 pm:
>
>> 
>> This isn't the behaviour I found here on a Linux box. The caller
>> process got 'stuck' and only worked again when the called proccess
>> ended.
>>
>         Strange...

OK... I tracked it down and found the 'P_NOWAIT' didn't work. I
replaced it with '1' (no quotes) and everything went fine on bot OSs.

The error message on Windows helped finding it out (it said that an
integer was expected but I got nothing on Linux). 

>         You might have to explicitly invoke the python executable, and pass 
> /it/ the .py file as the first argument

It ended up like this:

   os.spawnv(1, 'c:/python22/pythonw.exe', ['c:/python22/pythonw.exe', 'another.py', parameter])


This avoided the need for threads on this program, thanks.


Just to make the solution complete, only the 'thread' module worked on
Windows. I couldn't get the 'threading' module to work there.



Thanks for all the help.



See you,
-- 
Godoy.     <godoy at metalab.unc.edu>




More information about the Python-list mailing list