How to write data to existing process's STDIN from external process?
I'm seeking for ways to write data to the existing process's STDIN from external processes, and found similar question How do you stream data into the STDIN of a program from different local/remote processes in Python? in stackoverlow. In that thread, @Michael says that we can get file descriptors of existing process in path like below, and permitted to write data into them on Linux. /proc/$PID/fd/ So, I've created a simple script listed below to test writing data to the script's STDIN (and TTY ) from external process. #!/usr/bin/env python import os, sys def get_ttyname(): for f in sys.stdin,