I'm trying to get the output of another process in python3
Here si my code
proc = subprocess.Popen(BIN, stdout=subprocess.PIPE)
try:
outs = proc.communicate(timeout=10)[0]
except subprocess.TimeoutExpired:
proc.kill()
outs = proc.communicate()[0]
The problem is :
BIN is an executable that never finish, so TimeoutExpired is always raised. But I'm unabled to get the output in the except block
Thank's for reading