How to I send keystroke to Linux process in Python by PID?
Question: One simple question: I have Linux process ID, which is 3789. How can I send
'ENTER' to this process by using Python?


Answer: You are able to do such thing but with proc name using Python
[subprocess](https://docs.python.org/2/library/subprocess.html#subprocess.Popen)
but not with PID.

    
    
    from subprocess import Popen, PIPE
    p = Popen(['proc_name', filePath], stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
    p.stdin.print('\n') # sends Enter into process
    

