python pipe solo stdin, una vez, cómo hacerlo dos o más veces
Éxito de la tubería de Python, solo una vez esta fuente
main.py
import subprocess from subprocess import PIPE, STDOUT
player_pipe = subprocess.Popen(["source\call.py", 'arg1'], stdin=PIPE,
stdout=PIPE, stderr=STDOUT, shell=True)
player_pipe.stdin.write("Send Msg\n")
get_stdout = player_pipe.stdout.readline()
print("[Get Msg]" + get_stdout)
player_pipe.kill()
player_pipe.wait()
call.py
import sys
getMsg = raw_input()
print getMsg
pero quiero dos o más veces stdin, fuera
así que actualiza la fuente pero no funciona
¿Qué pasa esta fuente?
main.py (actualización no funciona)
import subprocess from subprocess import PIPE, STDOUT
player_pipe = subprocess.Popen(["source\call.py", 'arg1'], stdin=PIPE,
stdout=PIPE, stderr=STDOUT, shell=True)
player_pipe.stdin.write("Send Msg\n")
get_stdout = player_pipe.stdout.readline()
print("[Get Msg]" + get_stdout)
player_pipe.stdin.write("Send Msg2\n")
get_stdout = player_pipe.stdout.readline()
print("[Get Msg]" + get_stdout)
player_pipe.kill()
player_pipe.wait()
call.py (actualización no funciona)
import sys
getMsg = raw_input()
print getMsg
getMsg2 = raw_input()
print getMsg2
:RE