mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-07 06:24:10 +02:00
Updated python interface.
This commit is contained in:
parent
9b8f079899
commit
68f9b473a6
2 changed files with 11 additions and 7 deletions
|
@ -16,12 +16,16 @@
|
|||
QString PythonInterface::getPythonCommand() {
|
||||
#ifdef Q_OS_WIN
|
||||
if (_pythonCommand.isNull()) {
|
||||
QString pythonPath = PathUtils::getPathToExecutable("python.exe");
|
||||
// Use the python launcher as we need python 3, and python 2 may be installed
|
||||
// See https://www.python.org/dev/peps/pep-0397/
|
||||
const QString pythonLauncherExecutable{ "py.exe" };
|
||||
QString pythonPath = PathUtils::getPathToExecutable(pythonLauncherExecutable);
|
||||
if (!pythonPath.isNull()) {
|
||||
_pythonCommand = pythonPath + _pythonExe;
|
||||
} else {
|
||||
QMessageBox::critical(0, "python.exe not found",
|
||||
"Please verify that pyton.exe is in the PATH");
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(0, pythonLauncherExecutable + " not found",
|
||||
"Please verify that py.exe is in the PATH");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
@ -35,4 +39,4 @@ QString PythonInterface::getPythonCommand() {
|
|||
#endif
|
||||
|
||||
return _pythonCommand;
|
||||
}
|
||||
}
|
|
@ -18,7 +18,7 @@ public:
|
|||
|
||||
private:
|
||||
#ifdef Q_OS_WIN
|
||||
const QString _pythonExe{ "python.exe" };
|
||||
const QString _pythonExe{ "py.exe" };
|
||||
#else
|
||||
// Both Mac and Linux use "python"
|
||||
const QString _pythonExe{ "python" };
|
||||
|
@ -27,4 +27,4 @@ private:
|
|||
QString _pythonCommand;
|
||||
};
|
||||
|
||||
#endif // hifi_PythonInterface_h
|
||||
#endif // hifi_PythonInterface_h
|
Loading…
Reference in a new issue