Opening/Running files through python

Discussion in 'Python' started by Ionis, Jan 17, 2008.

  1. Ionis

    Ionis Guest

    Hey guys, hope you can help me here.

    I am running in windows and I am trying to open a file via python. I
    want the file (a text file) to open up in the users default text
    editor. I'm not wanting to read a file, I just want to open it. Is
    there a way?

    Thanks in advance.
    Ionis, Jan 17, 2008
    #1
    1. Advertising

  2. Ionis

    Tim Golden Guest

    Ionis wrote:
    > Hey guys, hope you can help me here.
    >
    > I am running in windows and I am trying to open a file via python. I
    > want the file (a text file) to open up in the users default text
    > editor. I'm not wanting to read a file, I just want to open it. Is
    > there a way?


    <code>
    import os
    os.startfile ("blah.txt")
    </code>
    Tim Golden, Jan 17, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGV2aW4=?=

    Opening New Window through code

    =?Utf-8?B?RGV2aW4=?=, Apr 22, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    452
    Steve C. Orr [MVP, MCSD]
    Apr 28, 2004
  2. microsoft
    Replies:
    1
    Views:
    2,528
    bruce barker
    Oct 5, 2004
  3. Replies:
    3
    Views:
    499
  4. ruds
    Replies:
    2
    Views:
    569
  5. fniles
    Replies:
    0
    Views:
    262
    fniles
    Apr 26, 2009
Loading...

Share This Page