我正在尝试从 php 执行我的 python 脚本,如下所示
exec('python C:/wamp/www/Proj/bin/test_wrapper.py');
它没有启动 test_wrapper.py 然后我尝试使用 C++ 而不是 test_wrapper.py 创建一个 exe 并尝试从我的 php 调用该 C++ exe,如下所示
exec('C:/wamp/www/Proj/bin/LaunchEngine.exe');
它没有再次工作。我确信我在使用 exec() 时遗漏了一些非常基本的东西。我是 python 和 php 的初学者。我的 php、python/C++ exe 在同一个子目录(bin)中。请帮我。作为参考,这是我的 python 脚本 test_wrapper.py 导入子进程
def main():
script=subprocess.Popen('python proj2xml.py')
script.wait()
script=subprocess.Popen('python cost2xml.py')
script.wait()
launch_fcs_engine=subprocess.Popen('fcs.exe')
launch_fcs_engine.wait()
if __name__ == '__main__':
main()
提前致谢