background process in python with -e option on terminal
Question: I want to write a console based wrapper to launch a program, and it works fine
unless I try to run it using 'urxvt -e myscript' or some variant. For example:

test.py

    
    
    #!/usr/bin/python2.7
    import subprocess
    
    print 'Press enter to launch'
    raw_input()
    
    subprocess.Popen( ['firefox'] )
    

If i run this in a terminal with ./test.py, it works as expected. Firefox
launches, the script exists. But if i try this with 'urxvt -e ./test.py' the
script opens, runs, and firefox launches. But when the script exits firefox is
killed.

How can I launch a program so its not killed when the script exits if I run
the script using 'term -e script'.

Edit: To be more clear: I want to launch a new terminal which runs the python
script. The script does its thing and launches the program. Then the script
exits, the terminal closes, and the program remains running.


Answer: add the ampersand symbol (&) to the command you launch.

    
    
    subprocess.Popen( ['firefox &'] )
    

