[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Open a file with default handler app?

AK

3/12/2008 4:24:00 AM

Hi, I searched for this on google and in this group, but my awesome
google-fu powers failed me. Is there a way to open any file using
default program that'd open it? In other words, to do the same action
as double-clicking in windows explorer? And secondly, is there a way
to do the same thing for linux that'd work across all desktop
environments and distributions, or at least in all major ones? What
I'm trying to do here is to have records (or items) in my app where
you could attach any kind of file and open it from there by clicking
'open'. Then it would go and do something like os.system("launch %s" %
filename). So any way to do this except for keeping your own
dictionary of file types and relevant apps? thx, -ak
5 Answers

Wubbulous

3/12/2008 4:50:00 AM

0

On Mar 11, 9:24 pm, andrei....@gmail.com wrote:
> Hi, I searched for this on google and in this group, but my awesome
> google-fu powers failed me. Is there a way to open any file using
> default program that'd open it? In other words, to do the same action
> as double-clicking in windows explorer? And secondly, is there a way
> to do the same thing for linux that'd work across all desktop
> environments and distributions, or at least in all major ones? What
> I'm trying to do here is to have records (or items) in my app where
> you could attach any kind of file and open it from there by clicking
> 'open'. Then it would go and do something like os.system("launch %s" %
> filename). So any way to do this except for keeping your own
> dictionary of file types and relevant apps? thx, -ak

Hey there,
I've had to do the same things for a program that I'm writing. The
following command should do the trick:

os.startfile("yourfilehere")

from the os module. Hope this helps!

AK

3/13/2008 12:08:00 AM

0

On Mar 11, 11:50 pm, Wubbul...@gmail.com wrote:

>
> Hey there,
> I've had to do the same things for a program that I'm writing. The
> following command should do the trick:
>
> os.startfile("yourfilehere")
>
> from the os module. Hope this helps!

That's perfect, thanks a ton++!

ldnayman

2/18/2011 3:16:00 PM

0

An EM or early digital like Joker Poker.

Newer games really aren't that much fun to play multiplayer unless
everybody is drunk. Long ball times, EBs etc aren't really conducive
to multiplayer, especially when the skill levels of the players vary
greatly.

Troy

2/18/2011 5:35:00 PM

0

On Feb 18, 10:16 am, ldnayman <ldnay...@aol.com> wrote:
> An EM or early digital like Joker Poker.
>
> Newer games really aren't that much fun to play multiplayer unless
> everybody is drunk. Long ball times, EBs etc aren't really conducive
> to multiplayer, especially when the skill levels of the players vary
> greatly.

Just play two games at once. That's what we do. Less "wait time".

ldnayman

2/18/2011 7:33:00 PM

0

On Feb 18, 12:34 pm, Troy <tbanth...@yahoo.com> wrote:
> On Feb 18, 10:16 am, ldnayman <ldnay...@aol.com> wrote:
>
> > An EM or early digital like Joker Poker.
>
> > Newer games really aren't that much fun to play multiplayer unless
> > everybody is drunk. Long ball times, EBs etc aren't really conducive
> > to multiplayer, especially when the skill levels of the players vary
> > greatly.
>
> Just play two games at once.   That's what we do.   Less "wait time".

I can't do that. Hard to get into the flow of a game playing two of
them at once.