Код: Выделить всё
(())(((())(()))((())))
1 2 1 2 1 2 5 1 2 3 9
Но когда я запускаю это:
Код: Выделить всё
output = ""
proc = subprocess.Popen([exe_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
try:
stdout, _ = proc.communicate("(())(((())(()))((())))\n", timeout=3)
output = stdout.rstrip()
except subprocess.TimeoutExpired:
print("Timeout expired. The program took too long to run.")
proc.terminate()
Интересно, почему. извините за мой плохой английский.
Подробнее здесь: https://stackoverflow.com/questions/781 ... ommunicate