473,657 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

os.startfile / webbrowser + Firefox

Hi,

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

Jul 18 '05 #1
2 3485
On 6 Jul 2004 10:52:17 GMT, Matthias Huening <mh******@zedat .fu-berlin.de>
wrote:
Hi,

os.startfile('h ttp://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('h ttp://www.python.org' )
Traceback (most recent call last):
File "<pyshell#2 >", line 1, in -toplevel-
os.startfile('h ttp://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\li b\webbrowser.py ", line 43, in open
get().open(url, new, autoraise)
File "C:\Python23\li b\webbrowser.py ", line 250, in open
os.startfile(ur l)
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('h ttp://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('h ttp://www.python.org' )
|
| Traceback (most recent call last):
| File "<pyshell#2 >", line 1, in -toplevel-
| os.startfile('h ttp://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\li b\webbrowser.py ", line 43, in open
| get().open(url, new, autoraise)
| File "C:\Python23\li b\webbrowser.py ", line 250, in open
| os.startfile(ur l)
| 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
3111
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 >>> webbrowser.open("http://www.python.org") It does not throw an exception, but is not able to launch a browser.
19
2356
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 short script to open a local file the same way, using the script file as an example target: # browser-test.py import webbrowser import sys
3
16629
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') Traceback (most recent call last): File "<interactive input>", line 1, in ? TypeError: startfile() takes exactly 1 argument (2 given)
8
4628
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." I just installed python 2.5, looking forward to being able to control firefox without having to make it my default browser, but... I don't seem to have that functionality. In IDLE: {'windows-default': }
0
5557
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
4
3745
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 if I open a cygwin bash shell and try the same thing from a python prompt, I get: Traceback (most recent call last):
14
2088
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 information. True It opens firefox as expected, but the url is ...
2
8075
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 documentation about os.startfile: "Start a file with its associated application. This acts like double-clicking the file in Windows Explorer, or giving the file name as an argument to the start command from the interactive command shell: the file is...
4
4473
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 webbrowser it shows scripting errors: There are a lot more sites that encounters scripting problems though they work just fine in Firefox, a sample: http://www.anaivanovic.com/forum/login.php
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8315
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8608
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.