Spawning a new UI process

Discussion in 'Python' started by Ed Leafe, Nov 9, 2008.

  1. Ed Leafe

    Ed Leafe Guest

    I'm working on a wxPython app (well, a Dabo app, but it's basically
    the same thing) that presents the user with a selection of several
    wxPython apps that exist on their system. They choose one, and I want
    to then "launch" that app, as if they had typed "python myapp.py" from
    a terminal window. The initial app can either terminate or continue;
    that's not terribly important. The important thing is to get the
    selected app to run in a separate process.

    I've tried all the variants of os.spawn* and os.exec*, without
    success. Either nothing happens, or a Python interpreter is opened in
    the Terminal window I used to run the launcher. I want to do something
    like:

    cd (appdir)
    pth = os.path.join(os.getcwd(), "main.py")

    followed by one of:

    os.spawnl(os.P_NOWAIT, "main.py")
    os.spawnl(os.P_NOWAIT, pth)
    os.spawnl(os.P_NOWAIT, "python", pth)
    os.spawnl(os.P_NOWAIT, "python", "main.py")
    os.spawnl(os.P_NOWAIT, "/usr/bin/python", pth)
    os.spawnl(os.P_NOWAIT, "/usr/bin/python", "main.py")

    The only result I've gotten is a Python interpreter is started, but
    the GUI app that should be launched by 'main.py' is never run.

    So what am I missing? How do I launch a python app in a separate
    process from another Python app?


    -- Ed Leafe
     
    Ed Leafe, Nov 9, 2008
    #1
    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. POL8985
    Replies:
    1
    Views:
    590
    Kevin Spencer
    Jan 31, 2005
  2. Replies:
    4
    Views:
    1,301
    Kevin Spencer
    Feb 8, 2005
  3. Marianne
    Replies:
    4
    Views:
    584
    Juan T. Llibre
    Jul 7, 2005
  4. Ashish

    spawning a process from webform1

    Ashish, Jul 11, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    355
    Ashish
    Jul 11, 2005
  5. Prachi
    Replies:
    7
    Views:
    233
Loading...

Share This Page