I have python program main.py
import subprocess
p = subprocess.Popen(
"/usr/bin/gnome-terminal -x 'handler.py'",
shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE)
p.stdin.write('Text sent to handler for display\n')
where handler.py is
#!/usr/bin/python
print "In handler..."
Program main.py opens a new gnome-terminal and runs handler.py to display "In handler...". How can I get handler.py to receive and print "Text sent to the handler for display" sent from main.py?
The answer provided to question "Sending strings between python scripts" is the idea of what I'm after, where handler.py runs in the terminal session created by main.py.