标签:style bin file run pytho report logs started qprocess
QProcess *proc = new QProcess(); proc->setEnvironment(proc->environment()); QString appPath = QCoreApplication::applicationDirPath(); proc->start(tr("sh ")+appPath+tr("/abc")); // proc->start(tr("python ")+appPath+tr("/generateHtmlOfDryRunReport.py")); 这种方法不知道为什么不可以 // ui->dryRunFilePath->setText(tr("python ")+appPath+tr("/generateHtmlOfDryRunReport.py")); ui->dryRunFilePath->setText(tr("sh ")+appPath+tr("/abc")); proc->waitForStarted();
abc脚本:
#!/bin/bash cd `dirname $0` python generateHtmlOfDryRunReport.py exit 0
QProcess::execute("python ./generateHtmlOfDryRunReport.py");
也能运行python脚本
标签:style bin file run pytho report logs started qprocess
原文地址:http://www.cnblogs.com/v-BigdoG-v/p/7296690.html