所以我用Scala发送这个系统命令:
val command = "python other/evaluateAnswers.py 'chemistry earth' 'the chemistry of the world in champaign' 'the chemistry of the computer science world'"
命令。!!在
下面是我的python代码的简化版本:
^{pr2}$如果我直接在终端内运行:
daniel$ python other/evaluateAnswers.py 'chemistry earth' 'the chemistry of the world in champaign' 'the chemistry of the computer science world'
以下是我的python代码中print(argv)
的结果:
['chemistry earth', 'the chemistry of the world in champaign', 'the chemistry of the computer science world']
这是正确的。在
如果我通过command.!!
从scala运行这个,我会在print(argv)
的输出中得到以下结果:
["'chemistry", "earth'", "'the", 'chemistry', 'of', 'the', 'world', 'in', "champaign'", "'the", 'chemistry', 'of', 'the', 'computer', 'science', "world'"]
这是不正确的分割。在
你知道我哪里出错了吗?在
手动拆分scala命令实现了以下目的:
相关问题 更多 >
编程相关推荐