os.system(cmd) isn't working

Paul Watson pwatson at redlinepy.com
Thu Jun 23 08:19:11 CEST 2005


"Gregory Piñero" <gregpinero at gmail.com> wrote in message 
news:mailman.787.1119499378.10512.python-list at python.org...
Hi guys,

I'm trying to run this statement:

os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + '
"www.blendedtechnologies.com"')

The goal is to have firefox open to that website.

When I type r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + '
"www.blendedtechnologies.com"' in the python interpreter I get:

'"C:\\Program Files\\Mozilla Firefox\\firefox.exe"
"www.blendedtechnologies.com"'

And when I copy this into my command prompt (less outermost ' )
firefox opens up to that page like I would expect.  However in python
nothing happens and I get exit status 1.

I'm using Python 2.3 on Windows XP pro service pack 2.

I'd greatly appriciate any help.

Thanks,

Greg

===============
These seemed to work on one machine for Python 2.1 and 2.4.

>>> os.system('\"C:/Program Files/Mozilla Firefox/firefox.exe\" 
>>> http://www.blendedtechnologies.com/')
1
>>> os.system('\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" 
>>> http://www.blendedtechnologies.com/')
1
>>> os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe" 
>>> http://www.blendedtechnologies.com/')
1 





More information about the Python-list mailing list