我想使用Runtime.getRuntime().exec来执行一个简单的python脚本Runtime.getRuntime().exec("python test.py"),它只包含很少的导入,但是错误FiReTiTiLiB/Test.py", line 6, in <module>ImportError: No module named PIL
当我在终端中执行相同的脚本时所以我用通向
使用Python,我希望创建一个子进程,并将其输出重定向到控制台的文件和。我找到了解释如何同时打印到控制台和文件的,但是在创建子进程时解决方案不起作用:print( "Hello") # printed to console andfile
res = subprocess.call(cmd) # command output is printed t