logging.basicConfig(filename='subptest.log', filemode='w', level=logging.INFO)
p = capture_stdout('python echotest.py', async=True)
while True:
    line = p.stdout.readline()
line = line.strip()
if line:
    print(line)
logging.info(line)
rc = p.commands[0].process.poll()
if not line and rc is not None:
    break
Вход из внешнего приложения