I am using qtcreator 4.0.1. I want to call python script in cmd prompt on a button click in qt creator. Using QProcess procedure is not resulting in any output. I have already many python scripts which needs to be incorporated into qt, so cannot go with using PythonQT. So I used cmd prompt to run scripts. Here is my code,but i am getting only the cmd prompt with no output.I have looked other ways of calling python scripts but didn't recieved expected results.
void Databasewin::store_clicked()
{
const char* cmd1 = cmd_qt.toLocal8Bit().constData();
system(cmd1);
system("pause>nul");
}
void Databasewin::store_clicked()
{
QString cmd_qt = QString("C:/Python27/python p2.py");
const char* cmd1 = cmd_qt.toLocal8Bit().constData();
system(cmd1);
system("pause>nul");
}
To copy to clipboard, switch view to plain text mode
Bookmarks