Output from two processes on shell (Python,Linux)
Question: My python script executes program that sends its output on shell. However,
script should simultaneously execute its own commands which also have its
output on shell. Is it possible to do that? Will I see output both from the
script and from the process? Here is the process that has output on shell:

    
    
    s.exe_cmd('./upgrade')
    

So, will I be able to write

    
    
    print "my output..."  
    

and see it on shell to?


Answer: Assuming you're using `subprocess` \- it will print both on the console.

    
    
    import subprocess
    
    p = subprocess.Popen("sleep 1 && echo from inside subprocess",
                         shell=True)
    print("will print asynchronously")
    p.wait()
    

This is an example program that you can try out

