



时间:2018-05-11 关注公众号 来源:3lian.com
1
2
3
4
5
6
7
|
import subprocess, TIMe
subproc = subprocess.Popen(['c:Python31python.exe', 'c:/b.py'], stdin=subprocess.PIPE, shell=True)
time.sleep(0.5)
print('start')
subproc.stdin.write('datan')
subproc.communicate('datan')
print('end')
|
b.py:
?
1
2
3
4
|
import sys
print('receive...')
s = sys.stdin.readline()
print('get:', len(s), s)
|
文章内容来源于网络,不代表本站立场,若侵犯到您的权益,可联系我们删除。(本站为非盈利性质网站)
电话:13918309914
QQ:1967830372
邮箱:rjfawu@163.com