【发布时间】:2018-07-30 08:09:24
【问题描述】:
我使用 python 子进程运行 python 脚本test.py。我想发送两个字符串'John', 'Henry' 作为参数并从test.py 中读取参数值。我想要这样的东西
subprocess.call(['python3', 'test.py']) #add two names 'John', 'Henry' as argument
test.py
print(name1) #print John
print(name2) #print Henry
我该怎么做?
【问题讨论】:
-
你有尝试过吗?鉴于您提供的信息,非常不清楚您是如何提出第一行但无法使其发挥作用的。
标签: python