/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
subprocess_example/child_in_loop/loop.py
20 строк
494 B
gil9red
Refactoring. Using black code style
27 июн 2023, 14:06
27 июн 2023, 14:06
e496bfb
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" import sys from subprocess import Popen, PIPE if __name__ == "__main__": # with Popen('python child.py', stdin=PIPE, stdout=PIPE, shell=True) as proc: # for line in proc.stdout: # print(line) with Popen( [sys.executable, "-u", "child.py"], stdout=PIPE, universal_newlines=True ) as process: for line in process.stdout: print(line.replace("!", "#"), end="")