标签: python-2.7 file subprocess
所以我们假设我有2个文件:file1.py和file2.py
file1.py
x = 0 def test(): subprocess.check_output(['python', 'file2.py', 'arg1', 'arg2']) print x
file2.py
#somecoderan from the file1command x=1
当我打电话给我想要打印的测试功能时1.有办法吗?