launching a file with its associated application on windows

Volucris volucris at hotmail.com
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) hotmail.com
"Eu não falo uma única palavra do português."
"Tim Peters" <tim.one at home.com> wrote in message
news:mailman.993076625.9823.python-list at python.org...
> [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,
the
> Windows-specific os.startfile() does exactly that.
>
>





More information about the Python-list mailing list