如果我运行一个脚本,该脚本运行并将参数传递给另一个脚本
python = 'C:/Python27/'
route = 'D:/core.py'
arguments = '{'a': 'apple'}'
subprocess.call('{0} {1} {2}'.format(python, route, arguments))
在core.py中,我只获得'{'a':
作为参数,空格之后的所有内容都将丢失。有解决方法吗?
答案 0 :(得分:0)
更改此行 争论=' {' a':' apple'}' 至 争论=" {' a':' apple'}"