I want to run script written in Python and get all output from that. This is my cpp code
QProcess process;
process.setProcessChannelMode(QProcess::MergedChannels);
QString exe = "python script.py";
process.start(exe);
process.waitForFinished(-1);
QString output(process.readAllStandardOutput());
qDebug() << output << endl;
and my script.py
import sys
print("Hello world!")
The strange thing is when I change "python script.py" to "ping google.com" it's working like a charm. I checked it also on my cmd, but it seems that my Python installation is also good. Where I'm doing it wrong?
[EDIT 1] echo %PATH%
C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Users\Micha\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\Micha\AppData\Local\Programs\Python\Python35-32\;C:\NVPACK\gradle-2.9\bin;C:\NVPACK\apache-ant-1.8.2\bin;C:\NVPACK\jdk1.8.0_77\bin;C:\NVPACK\android-ndk-r12b;C:\NVPACK\android-sdk-windows\extras\android\support;C:\NVPACK\android-sdk-windows\build-tools;C:\NVPACK\android-sdk-windows\platform-tools;C:\NVPACK\android-sdk-windows\tools;C:\Users\Micha?\AppData\Local\atom\bin;C:\Users\Micha\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin