473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

starting windows program from python based on file extension ?

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 ??

Many thanks,

Alex

Jul 18 '05 #1
2 1410
Le 3 Mar 2005 02:53:51 -0800, ko****@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

Jul 18 '05 #2
wrote:
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 webbrowser
webbrowser.open('test.html')


Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Patrick Useldinger | last post by:
Hi, I am writing a filter, i.e. a program that reads from stdin and writes to stdout. It works ok when run on its own, but does not work when I try to use another program's output. - The...
2
by: Olli Piepponen | last post by:
Hi, I'm having a little problem catching keystrokes under Windows. I did a little research and found that with mscvrt.getch() one can cath a single key that is pressed. However this doesn't work...
14
by: BOOGIEMAN | last post by:
Well that's it, how do I make Windows Application with Python ??? Is there simple way that works 100% ? How can I rework visual design done in VS 2003 to use it for my python program ?
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
27
by: Julien Fiore | last post by:
Do you wand to install Pyrex on Windows ? Here is a step-by-step guide explaining: A) how to install Pyrex on Windows XP. B) how to compile a Pyrex module. Julien Fiore, U. of Geneva
6
by: tatamata | last post by:
Hello. How can I run some Python script within C# program? Thanks, Zlatko
20
by: W. Watson | last post by:
I downloaded python-2.5.msi and installed it. I believe its editor is IDE. I understand there's a Win editor called pythonwin. I believe it's in the download pywin32-210.win32-py2.5.exe, but I'm...
4
by: durumdara | last post by:
Hi! My problem is that: The "test.py" is working in every machine that I use except in my home machine. Formerly it worked but now not. I don't know what happened, I searching for some...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.