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.

Qt Code:
  1. void Databasewin::store_clicked()
  2. {
  3. QString cmd_qt = QString("C:/Python27/python p2.py");
  4.  
  5. const char* cmd1 = cmd_qt.toLocal8Bit().constData();
  6. system(cmd1);
  7. system("pause>nul");
  8. }
To copy to clipboard, switch view to plain text mode