How to start up the default web browser on win32

seanb at home.com seanb at home.com
Tue Feb 29 17:09:07 EST 2000


On  1 Mar, T. C. Huang wrote:
> Hi,
> 
>      I want to write a python script to start up the default web browser
> on Win32 platform. I'm not
> familiar with Win32, anyone can help me?
> 
> T. C. Huang
> 

The easiest way I know of is to use the windows "start" command (which
launches a program or opens a document in the associated program) to
open a url.  For example:

>>import os
>>my_url = 'http://www.python.org/'
>>os.system('start %s' % my_url)
-- 
Sean Blakey
(206)297-7123
quine = ['print "quine =",quine,"; exec(quine[0])"']; exec(quine[0])





More information about the Python-list mailing list