473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

os.startfile / webbrowser + Firefox

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'

Jul 18 '05 #1
2 3467
On 6 Jul 2004 10:52:17 GMT, Matthias Huening <mh******@zedat.fu-berlin.de>
wrote:
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'

I hate to say but it worked for me using Opera as my default browser
on Windows 2000 but fails with Firefox so I guess it's a Firefox thing...

FYI webbrowser just calls os.startfile on windows hence the same error
Martin
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 18 '05 #2

"Matthias Huening" <mh******@zedat.fu-berlin.de> schrieb im Newsbeitrag
news:Xn**********************************@130.133. 1.4...
| 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'
| >>>
I have the same issue with FF 0.9.1 (can't really say if I had the same
problem with prior versions - maybe I didn't notice) as default browser on
XP Prof. Not only when starting a url from Python, but also from other
programs, yes: even when double clicking a *.url. FF loads the page just
fine, but the "invoking program" always returns an error message.

--
Vincent Wehren

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>>...
19
by: Blair P. Houghton | last post by:
I'm just learning Python, so bear with. I was messing around with the webbrowser module and decided it was pretty cool to have the browser open a URL from within a python script, so I wrote a...
3
by: BartlebyScrivener | last post by:
Can any Windows user give a working example of adding a "command verb" to os.startfile()? When I try it, it squawks that it takes only one argument. >>> os.startfile('d:/','explore')...
8
by: Dustan | last post by:
At http://docs.python.org/whatsnew/modules.html on the webbrowser module, it says "A number of additional browsers were added to the supported list such as Firefox, Opera, Konqueror, and elinks." ...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
by: Gregory Bloom | last post by:
I'm running Python 2.5 under Windows. If I fire up IDLE and enter: it works like a champ, opening the page in Firefox. Same thing goes from a Windows cmd shell: it works as advertised. But...
14
by: Ron Adam | last post by:
Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) on linux2 Type "help", "copyright", "credits" or "license" for more...
2
by: dazzler | last post by:
I need to open PDF file with my python application, and I'm using os.startfile(filename.pdf) command, I would need open command act 100% like clicking the file in the windows explorer python...
4
by: kimiraikkonen | last post by:
Hi, Just to test, i placed a simple webbrowser to login a site, this site has no problems and has same error with IE6 SP2 but it's suppressed as well and no problem with Firefox browser, but using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.