webbrowser problems

Keith Lackey keith at cgcreator.com
Tue May 30 16:24:14 CEST 2006


I'm having trouble trying to pass arguments to a file path url. ie
c:/testPython/test.html?testArg=testValue

 

import webbrowser

 

webbrowser.open("c:/testPython/test.html") # Works

webbrowser.open("c:/testPython/test.html?testArg=testValue") # Doesn't Work

 

webbrowser.get() # Returns a WindowsDefault instance

 

 

I looked into the webbrowser python command, and see that windows default
just does a os.filestart(url) call.

If I use the command prompt to try and mimic this it also errors out which
is what I would expect.

 

But if I run this from the command line. it seems to work fine:

 

c:\Program Files\Internet Explorer\iexplore.exe
c:/testPython/test.html?testArg=testValue

 

I assume this is because the url is being passed as an argument to the
iexplore.exe instead of trying to find a file call that url.

 

I guess what I need to do is try and find the file path to the default
browser so that I can build my own string to execute via command line. But I
have no clue as to how I would go about getting that. and also I want to
make sure its still going to be cross platform compatible.

 

Any help? Ideas?

 

Thanks

Keith

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060531/b3a89ee0/attachment.html>


More information about the Python-list mailing list