使用子流程:
from subprocess import Popen, PIPEscpt = ''' on run {x, y} return x + y end run'''args = ['2', '2']p = Popen(['osascript', '-'] + args, stdin=PIPE, stdout=PIPE, stderr=PIPE)stdout, stderr = p.communicate(scpt)print (p.returnpre, stdout, stderr)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)