Hi
I was making a program that tried to open firefox like this:

exec file('C:\\Program Files\\Mozilla Firefox\\firefox.exe')

but i get an error

exec file('C:\\Program Files\\Mozilla Firefox\\firefox.exe')
  File "C:\Program Files\Mozilla Firefox\firefox.exe", line 1
SyntaxError: Non-ASCII character '\x90' in file C:\Program Files\Mozilla Firefox\firefox.exe on line 1, but no encoding declared; see [url]http://www.python.org/peps/pep-0263.html[/url] for details (firefox.exe, line 1)

does anyone know how to open firefox and perhaps also to direct it so a predetermined website

Yeah that webbrowser module is great!
i ended up using:

import webbrowser
webbrowser.open('www.google.com')

thanks everyone

This article has been dead for over six months. Start a new discussion instead.