How to launch another program from GUI button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maximus tee
    New Member
    • Dec 2010
    • 30

    How to launch another program from GUI button?

    hi all,

    i wrote a simple GUI with 2 buttons. Button1 is to launch another program. Button2 is to run test. When I click Button1, it will launch another program. After launching the program, my GUI window is still waiting until i exit the program. How can the GUI window gain control after launching another program? i used os.system to launch the other program. pls help.

    thanks
    maximus
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    After launching the program, my GUI window is still waiting until i exit the program. How can the GUI window gain control after launching another program?
    What does this mean? Do you want to close the window after launching the program?

    Comment

    • maximus tee
      New Member
      • Dec 2010
      • 30

      #3
      hi,

      from one python GUI script, i want to launch another program by clicking to a button. i used os.system but the GUI is waiting until the program launched is closed.

      thanks
      maximum

      Comment

      • dwblas
        Recognized Expert Contributor
        • May 2008
        • 626

        #4
        Most GUI's include a Destroy method http://www.wxpython.org/docs/api/wx....s.html#Destroy, so the function referenced/called when button1 is pressed, calls destroy() on the top/main window and then os.system().

        Comment

        • maximus tee
          New Member
          • Dec 2010
          • 30

          #5
          thanks for the advice. i'm using Tkinter but let me explore the link you gave me. currently it works by using os.popen command.

          Comment

          Working...