你好,
虽然你在“run_mycode相同的目录中。sh”文件,Bash无法找到这个文件。
因为
当前目录
不是
在您的$ PATH变量中
Linux
bash。
在Linux中,
UNIX
及相关操作
系统中,
”
。
”
表示
当前目录。既然你想要运行一个文件在当前目录,目录在您的$ PATH中不是,你需要
”
。
/
”
位
告诉shell执行在哪里。所以,。/ run_mycode。上海means run the executable called run_mycode.
上海
在这个目录中。
因此,
你
需要指定的相对或绝对路径文件,以便知道我们的可执行文件。
关于你的情况,
代码是这样的:
从子流程导入电话
mypart = / mycomputer / part.mat
mcr_path =“mycomputer / matlab / MATLAB_Compiler_Runtime /跟v91”
arg =“1”“”“”+ mypart
cmd =”。/ run_mycode。sh '+ mcr_path +”“+参数%增加。/
% run_mycode.sh
调用(cmd,壳牌= True)
希望这个有帮助。