[SOLVED] Re: Threading and Windows.
Bengt Richter
bokr at oz.net
Wed Oct 1 00:27:38 EDT 2003
On Tue, 30 Sep 2003 10:54:57 -0300, Jorge Godoy <godoy at metalab.unc.edu> wrote:
>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.
>
What is os.P_NOWAIT on your system? It looks like '1' (no quotes) on my system:
>>> import os
>>> os.name
'nt'
>>> os.P_NOWAIT
1
>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])
So one would think
os.spawnv(os.P_NOWAIT, 'c:/python22/pythonw.exe',
['c:/python22/pythonw.exe', 'another.py', parameter])
would work, except I note that os.P_NOWAIT is not defined in Python 1.5.2 on Linux (slackware).
Gotta upgrade one of these days... My nt python is 2.3 though, but I don't suppose that's changed
since the 2.2 you are apparently running on windows??
Regards,
Bengt Richter
More information about the Python-list
mailing list