OpenMS
2.8.0
|
Detect Python and retrieve information. More...
#include <OpenMS/SYSTEM/PythonInfo.h>
Static Public Member Functions | |
static bool | canRun (String &python_executable, String &error_msg) |
Determine if Python is installed and executable. More... | |
static bool | isPackageInstalled (const String &python_executable, const String &package_name) |
Determine if the Python given in python_executable has the package package_name already installed. More... | |
static String | getVersion (const String &python_executable) |
Determine the version of Python given in python_executable by calling '–version'. More... | |
Detect Python and retrieve information.
Similar classes exist for other external tools, e.g. JavaInfo .
Determine if Python is installed and executable.
The call fails if either Python is not installed or if a relative location is given and Python is not on the search PATH. If Python is found, the executable name will be modified to the absolute path. If Python is not found, an error message will be put into error_msg
python_executable | Path to Python executable. Can be absolute, relative or just a filename |
error_msg | On error, contains detailed error description (e.g. |
Determine the version of Python given in python_executable
by calling '–version'.
If Python cannot be found, the function will return the empty string. Thus, make sure that PythonInfo::canRun() succeeds before calling this function.
python_executable | As determined by canRun()... |
|
static |
Determine if the Python given in python_executable
has the package package_name
already installed.
If Python cannot be found, the function will just return false. Thus, make sure that PythonInfo::canRun() succeeds before calling this function.
python_executable | As determined by canRun()... |
package_name | The package you want to test (mind lower/upper case!) |