Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # test.py - открываем в браузере
- #!/usr/bin/env python3
- import subprocess, sys
- sys.stdout.buffer.write(b'Content-type: text/html;charset=utf-8\n\n')
- r = subprocess.Popen('./test2.py | at now', shell=True) # пробовал и shell=False, передавая аргументы списком
- print('finished')
- exit(0)
- # test2.py - бесконечно пишет в файл test, пока работает
- #!/usr/bin/env python3
- import time, sys
- fp = open('test', 'w')
- while True:
- print('.',end='')
- fp.write('1')
- fp.flush()
- sys.stdout.flush()
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment