launching a file with its associated application on windows

Volucris volucris at
Wed Jun 20 20:09:51 EDT 2001

If it's pre 2.0, I think you can prefix a popen() command with 'start ' to
do the same thing.

import os
os.popen('start %s' % r'C:\sish\MyPic.bmp')


Volucris (a)
"Eu não falo uma única palavra do português."
"Tim Peters" < at> wrote in message
news:mailman.993076625.9823.python-list at
> [Christian Reyes]
> > Is there a method that takes a file as an argument and then opens
> > that file with the its associated viewer?
> This must be a Windows question, right?  If so, in Python 2.0 or later,
> Windows-specific os.startfile() does exactly that.

More information about the Python-list mailing list