Understanding Popen.communicate
Understanding Popen.communicate Question: I have a script named 1st.py which creates a REPL (read-eval-print-loop): print “Something to print” while True: r = raw_input() if r == ‘n’: print “exiting” break else: print “continuing” I then launched 1st.py with the following code: p = subprocess.Popen([“python”,”1st.py”], stdin=PIPE, stdout=PIPE) And then tried this: print p.communicate()[0] It failed, providing …
Total answers: 3