starting windows program from python based on file extension ?
F. Petitjean
littlejohn.75 at news.free.fr
Thu Mar 3 06:08:29 EST 2005
Le 3 Mar 2005 02:53:51 -0800, kowald at molgen.mpg.de a écrit :
> Hi everybody,
>
> I used python to build a HTML file and now I would like to
> automatically start my browser to display this file. I guess I could
> use os.system(), but then I had to specify a specific path to the
> browser.
>
> I wonder if it is possible to tell windows to open "myFile.html" using
> the program that is registered to open html files (similar to double
> clicking on the file).
>
> Any idea how to do that from python ??
import os
os.startfile("myFile.html")
# on windows only
>
> Many thanks,
>
> Alex
>
More information about the Python-list
mailing list