Is there any way of attaching a console's STDIN/STDOUT to an already running process?
Use Case:
I have a python script which runs another python script on the command line using popen
.
Let's say foo.py
runs popen
to run python bar.py
.
Then bar.py
blocks on input. I can get the PID of python bar.py
. Is there any way to attach a new console to the running python instance in order to be able to work interactively with it? This is specifically useful because I want to run pdb
inside of bar.py
.