mardif wrote:
> OK OK GUYS!!!!
> I've found the solution: ( effectly, a friend of mine has found the
> solution )
> 
> import os
> 
> os.spawnl(os.P_WAIT, "c:\programmi\internet
> explorer\iexplore.exe",'"C:\Documents and
> Settings\michele\Desktop\ciccio.html"','"C:\Documents and
> Settings\michele\Desktop\ciccio.html"')
> 
> The secret are the ' simbols around arguments:
> 
> ' "C:\Documents and Settings\michele\Desktop\ciccio.html" '
> 
> Without these, don't work!
> 
> Very STRONG!!!!!
> 
> bye and thx
> 
Wasn't that what I have suggested?

By the way:
it is much better to use double backslashes here, as in case of other 
file/directory names (e.g. folder\name.txt folder\remote.htm i.e. for 
all the cases a backslash is followed by a letter making out of this 
twin one special character) this above won't work.
But best is to use in full path file names forward slashes as Python 
handles them properly not only on *nix and Linux, but also on Windows:
'"C:/Documents and Settings/michele/Desktop/ciccio.html"'

The "secret" symbols around arguments are single quotation marks making 
the double quotation marks part of the string passed to the .spawnl() 
function. Check out in IDLE, that:
 >>> "x"
'x'
 >>> '"x"'
'"x"'
Command shell command arguments need to be enclosed in quotation marks 
in case spaces can occur in them (as it can happen in file names) as 
otherwise the spaces will be interpreted as separator characters between 
the arguments and as consequence of this the command shell command fails 
due to bad or wrong number of parameter.

You see, no "secrets" here ... only some simple rules and a bit more 
understanding of what is going on behind the scenes.

Claudio
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to