您的位置:首页 > 编程语言 > Python开发

【python】【opencv samples】【批处理】【Ubuntu】用Python对opencv samples进行批量生成可执行文件

2017-10-17 23:27 513 查看
用Python对opencv samples进行批量生成可执行文件.o

import os
for root, dirs, files in os.walk("."):
if(root == '.'):
for file in files:
if(len(file)>=5 and file[-3:] == 'cpp'):
fileName=str(file[0:-4])
#print(fileName)
print('g++' + str(file) + '-o'+fileName+'.o' + '`pkg-config --cflags --libs opencv`')
os.system('g++ ' + str(file) + ' -o '+'./build/'+fileName+'.o ' + ' `pkg-config --cflags --libs opencv`')
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐