只需写信给
/proc/PID/fd/1:
import os.pathpid = os.getpid() # Replace your PID here - writing to your own process is boringwith open(os.path.join('/proc', str(pid), 'fd', '1'), 'a') as stdin: stdin.write('Hello theren')
只需写信给
/proc/PID/fd/1:
import os.pathpid = os.getpid() # Replace your PID here - writing to your own process is boringwith open(os.path.join('/proc', str(pid), 'fd', '1'), 'a') as stdin: stdin.write('Hello theren')