Open HTML file in IE

Larry Bates larry.bates at websafe.com
Wed Jul 18 17:35:34 CEST 2007


gravey wrote:
> Hello.
> 
> Apologies if this is a basic question, but I want to open a HTML
> file from my local drive (is generated by another Python script)
> in Internet Explorer. I've had a look at the webbrowser module and
> this doesn't seem to be what I need. Any help much appreciated.
> 

There are several ways.  Assuming that IE is your default browser, just do:

import os
os.system('filename.html')

If you want to make certain that IE is launched (and not FireForx or some other
defult broswer) you can do:

os.system("start iexplore filename.html")

(at least this works on my system).

-Larry



More information about the Python-list mailing list