eric7.SystemUtilities.PythonUtilities

Module implementing Python related utility functions.

Global Attributes

None

Classes

None

Functions

__searchInterpreters_Linux Function to determine a list of all Python interpreters available via the executable search path (i.e.
__searchInterpreters_Windows Function to determine a list of all Python interpreters available via the executable search path (i.e.
determinePythonVersion Function to determine the python version of a given file.
getExePath
getPythonExecutable Function to determine the path of the (non-windowed) Python executable.
getPythonLibPath Function to determine the path to Python's library.
getPythonLibraryDirectory Function to determine the path to Python's library directory.
getPythonScriptsDirectory Function to determine the path to Python's scripts directory.
getPythonVersion Function to get the Python version (major, minor) as an integer value.
searchInterpreters Function to determine a list of all Python interpreters available via the executable search path (i.e.


__searchInterpreters_Linux

__searchInterpreters_Linux(environments=None)

Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (non Windows variant).

environments (list of str (optional))
list of environment directories to scan for Python interpreters (defaults to None)
Return:
list of found interpreter executables
Return Type:
list of str
Up


__searchInterpreters_Windows

__searchInterpreters_Windows(environments=None)

Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (Windows variant).

environments (list of str (optional))
list of environment directories to scan for Python interpreters (defaults to None)
Return:
list of found interpreter executables
Return Type:
list of str
Up


determinePythonVersion

determinePythonVersion(filename, source, editor=None)

Function to determine the python version of a given file.

filename (str)
name of the file with extension
source (str)
of the file
editor (Editor)
reference to the editor, if the file is opened already
Return:
Python version if file is Python3
Return Type:
int
Up


getExePath

getExePath(branch, access, versionStr)
Up


getPythonExecutable

getPythonExecutable()

Function to determine the path of the (non-windowed) Python executable.

Return:
path of the Python executable
Return Type:
str
Up


getPythonLibPath

getPythonLibPath()

Function to determine the path to Python's library.

Return:
path to the Python library
Return Type:
str
Up


getPythonLibraryDirectory

getPythonLibraryDirectory()

Function to determine the path to Python's library directory.

Return:
path to the Python library directory
Return Type:
str
Up


getPythonScriptsDirectory

getPythonScriptsDirectory()

Function to determine the path to Python's scripts directory.

Return:
path to the Python scripts directory
Return Type:
str
Up


getPythonVersion

getPythonVersion()

Function to get the Python version (major, minor) as an integer value.

Return:
integer representing major and minor version number
Return Type:
int
Up


searchInterpreters

searchInterpreters(environments=None)

Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (Windows variant).

environments (list of str (optional))
list of environment directories to scan for Python interpreters (defaults to None)
Return:
list of found interpreter executables
Return Type:
list of str
Up