os.startfile / webbrowser + Firefox

Matthias Huening mhuening at zedat.fu-berlin.de
Tue Jul 6 06:52:17 EDT 2004


Hi,

os.startfile('http://www.python.org') works fine on WinXP with IE as 
default webbrowser. With Mozilla Firefox 0.9 as default webbrowser, 
however, I get an error. Firefox starts, the page gets loaded and then 
Python gives me an error message (Traceback below). The same is true 
for the webbowser module. Is this a Python problem or a Firefox 
problem?

Matthias


>>> import os
>>> os.startfile('http://www.python.org')

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in -toplevel-
    os.startfile('http://www.python.org')
WindowsError: [Errno 2] Das System kann die angegebene Datei 
nicht finden: 'http://www.python.org'

>>> import webbrowser
>>> webbrowser.open('http://www.python.org')

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in -toplevel-
    webbrowser.open('http://www.python.org')
  File "C:\Python23\lib\webbrowser.py", line 43, in open
    get().open(url, new, autoraise)
  File "C:\Python23\lib\webbrowser.py", line 250, in open
    os.startfile(url)
WindowsError: [Errno 2] Das System kann die angegebene Datei 
nicht finden: 'http://www.python.org'
>>> 



More information about the Python-list mailing list