我是python的新手,正在尝试使用子进程通过python程序运行cmake。 这是我的代码:
test_path = "/home/yaodav/Desktop/test_clone_git/test/"
cmake_build_command = "cmake -Bcmake-debug-build -H. -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/c++ -Bcmake-debug-build -H. -DSYTEM_ARCH=x86_64-pc-linux-gnu-gcc-7.4.0"
cmake_link_command = "cmake --build cmake-debug-build --target all"
cmake_command = [test_path, cmake_build_command, cmake_link_command]
try:
out = subprocess.run(cmake_command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, stderr = out.communicate()
print(stdout)
print(stderr)
except Exception as e:
print(e)
但是当我运行它时
“权限被拒绝”
我检查了我的python文件权限和
-rwxrwxrwx。 1 yaodav yaodav 4387 11月3日05:05 git_puller.py
我该如何解决?