launching a file with its associated application on windows

Volucris volucris at hotmail.com
Thu Jun 21 18:13:14 EDT 2001


"Volucris" <volucris at hotmail.com> wrote in message
news:3b313ae6$0$327$6e49188b at news.goldengate.net...
> 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')

yeah, I'm stupid. That should be system() not popen(), although popen()
would work, too, depending on what exactly you are doing. You wouldn't want
a pipe to a (.bmp) file, though, would you? Maybe. I don't know. I'm
rambling again. Good bye.

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