Open a file with default handler app?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • andrei.avk@gmail.com

    Open a file with default handler app?

    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("laun ch %s" %
    filename). So any way to do this except for keeping your own
    dictionary of file types and relevant apps? thx, -ak
  • Wubbulous@gmail.com

    #2
    Re: Open a file with default handler app?

    On Mar 11, 9:24 pm, andrei....@gmai l.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("laun ch %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("y ourfilehere")

    from the os module. Hope this helps!

    Comment

    • andrei.avk@gmail.com

      #3
      Re: Open a file with default handler app?

      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("y ourfilehere")
      >
      from the os module. Hope this helps!
      That's perfect, thanks a ton++!

      Comment

      Working...