python程序
import subprocess
import sys
while(1):
subprocess.call("/home/your_host_name/caffe/detection_position/test_code/new/call_parse_position.sh", shell=True)
call_parse_position.sh 文件
#!/bin/bash
#
#
#gcc m1.cpp -o m1_run
echo "start run parse_position"
./parse_position_run
exit 0
Python调用Shell脚本示例
本文介绍了一个使用Python无限循环调用Shell脚本的示例。该Python程序通过subprocess模块执行一个名为call_parse_position.sh的Shell脚本,此脚本进一步执行一个名为parse_position_run的程序。示例展示了Python与Shell脚本之间的交互。
809

被折叠的 条评论
为什么被折叠?



