[SOLVED] Re: Threading and Windows.

Jorge Godoy godoy at metalab.unc.edu
Wed Oct 1 07:39:04 EDT 2003


bokr at oz.net (Bengt Richter) writes:

>>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

It is '1', just as in yours. I was saying that there's no 'P_NOWAIT'
(with quotes and no 'os.' prefix). :-)

> So one would think
>
>     os.spawnv(os.P_NOWAIT, 'c:/python22/pythonw.exe',
>               ['c:/python22/pythonw.exe', 'another.py', parameter])

Exactly. In fact it ended up as (this is in a separate method on the
main program):

        if (sys.platform == 'win32'):
            python = 'c:/python22/pythonw.exe'
            os.spawnv(os.P_NOWAIT, python, [python, program, parameter])
        else:
            os.spawnv(os.P_NOWAIT, program, [program, 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??

I'm running 2.2 on both platforms and with the 'os.' prefix everything
worked. :-)


Thanks,
-- 
Godoy.     <godoy at metalab.unc.edu>




More information about the Python-list mailing list