<< endl;
#endif
- out << lyx_version_info
+ out << lyx_version_info
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
<< Qt::endl;
#else
else
out << "</p><p>";
#endif
- out << toqstr(bformat(_("Python detected: %1$s"), from_utf8(os::python())));
+ out << toqstr(bformat(_("Python detected: %1$s"), from_utf8(os::python_info())));
if (!plain)
out << toqstr("</p></body></html>");
return res;
static string const python23_call(string const & binary, bool verbose = false)
{
- const string version_info = " -c \"from __future__ import print_function;import sys; print(sys.version_info[:2], end=\\\"\\\")\"";
+ const string version_info = " -c \"from __future__ import print_function; import sys; print(sys.version_info[:2], end='')\"";
// Default to "python" if no binary is given.
if (binary.empty())
return "python -tt";
return command;
#ifdef _WIN32
- // python launcher is not installed, let cmd auto check
+ // python launcher is not installed, let cmd auto check
// PATH for a python.exe
command = python23_call("python");
if (!command.empty())
return !(python23_call(python()).empty());
}
+string const python_info()
+{
+ const string info_version = " -c \"from __future__ import print_function; import sys; print('{} ({})'.format(sys.version.split()[0],sys.executable), end='')\"";
+ if (!hasPython())
+ return("None");
+ return (runCommand(python() + info_version).result);
+}
+
} // namespace os
} // namespace support
} // namespace lyx
/// Check for availability of the python interpreter
bool hasPython();
+/// Return information about the ython interper
+std::string const python_info();
+
///
bool isFilesystemCaseSensitive();