I am running a Java program, and with the Java program, I run a Python script. The python script (with subprocess.Popen) runs the command
screen -x hg1 -X stuff "jsp sign edit status1 2 test line $(printf '\r')"
...but when it does that, it retuns the error
Must be connected to a terminal.
I tried doing many things, including doing a bunch of switches (e.g. -dm, -d, -m, etc.), but none of them work.
How do I make screen stuff a command without giving me that error?
subprocess.call(['screen', '-x', 'hg1', '-X', 'stuff', 'jsp sign edit status1 2 test line \r'])
not work? Calling shell from Python called from Java sounds like you have a lot you want to simplify anyway.ssh -t localhost
before thescreen
command?