spawnv question

Daniel Klein danielk at aracnet.com
Tue Feb 13 10:32:23 EST 2001


Here is a snippet of code I'm using with the 'spawnv' command:

import os
args = ('http://www.python.org', 'http://www.python.org') # This works
os.spawnv(os.P_NOWAIT, 'c:\progra~1\intern~1\iexplore', args)
print "done"

The Python Reference for the 'spawnv' command says:

 "Execute the program path in a new process, passing the arguments specified in
args as command-line parameters. args may be a list or a tuple."

My question is, why do I have to specify the url argument twice in the 'args'
variable. It doesn't seem to work properly if I specify it as a 1-element
tuple, ie...

args = ('http://www.python.org',) # This doesn't work

Thanks,
Daniel Klein




More information about the Python-list mailing list