newbie question: starting external application(win)?

Discussion in 'Python' started by Frank Esselbach, Dec 9, 2004.

  1. Hello,

    I'am new in python. I need informations, how its possible run another
    (non-python) exe file from python without terminate the python system.

    I have googeled, but could not find informations that I can understand.
    The most informations comes from unix/linux butIneed this for win32.

    Thanks a lot, Frank
     
    Frank Esselbach, Dec 9, 2004
    #1
    1. Advertising

  2. > I have googeled, but could not find informations that I can understand.
    > The most informations comes from unix/linux butIneed this for win32.


    The module popen2 is your friend. Or the os.spawn* methods in module os.
    --
    Regards,

    Diez B. Roggisch
     
    Diez B. Roggisch, Dec 9, 2004
    #2
    1. Advertising

  3. Frank Esselbach

    Peter Hansen Guest

    Frank Esselbach wrote:
    > Hello,
    >
    > I'am new in python. I need informations, how its possible run another
    > (non-python) exe file from python without terminate the python system.
    >
    > I have googeled, but could not find informations that I can understand.
    > The most informations comes from unix/linux butIneed this for win32.


    There's a variety of options, ranging from os.popen and os.system
    through spawn, the new in 2.4 subprocess module, and os.startfile.

    Which one is best for you might depend on specifics. You can
    either read the docs for the "os" module or "subprocess", or
    tell us more detail. What exe are you trying to run, and how
    are you doing it now which is "terminating the python system"?

    -Peter
     
    Peter Hansen, Dec 9, 2004
    #3
  4. >The module popen2 is your friend. Or the os.spawn* methods in module
    os.

    Another (simpler IMO) way to do it is to use os.startfile.

    To start Notepad:
    >>> import os
    >>> os.startfile("notepad.exe")


    also, you can start an application from an associated file.

    Start MS Word with:
    >>> os.startfile("MyDocument.doc")


    /Johan Lindberg
     
    Johan Lindberg, Dec 9, 2004
    #4
    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. ARaman
    Replies:
    1
    Views:
    396
    Mike Wahler
    Oct 23, 2003
  2. Chris Lyon
    Replies:
    0
    Views:
    333
    Chris Lyon
    Oct 7, 2003
  3. Ringwraith
    Replies:
    4
    Views:
    953
    Ringwraith
    Jan 27, 2004
  4. Krist
    Replies:
    6
    Views:
    762
    Arne Vajhøj
    May 7, 2010
  5. Peter Singer

    Web Services on Win 2003 to SQL Server on Win 2000

    Peter Singer, Sep 7, 2004, in forum: ASP .Net Web Services
    Replies:
    10
    Views:
    295
    Yan-Hong Huang[MSFT]
    Sep 15, 2004
Loading...

Share This Page