Sat, 26 Apr 2025 12:34:32 +0200
MicroPython
- Added a configuration option to disable the support for the no longer produced Pimoroni Pico Wireless Pack.
<!DOCTYPE html> <html><head> <title>eric7.SystemUtilities.PythonUtilities</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>eric7.SystemUtilities.PythonUtilities</h1> <p> Module implementing Python related utility functions. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr><td>None</td></tr> </table> <h3>Functions</h3> <table> <tr> <td><a href="#__searchInterpreters_Linux">__searchInterpreters_Linux</a></td> <td>Function to determine a list of all Python interpreters available via the executable search path (i.e.</td> </tr> <tr> <td><a href="#__searchInterpreters_Windows">__searchInterpreters_Windows</a></td> <td>Function to determine a list of all Python interpreters available via the executable search path (i.e.</td> </tr> <tr> <td><a href="#getExePath">getExePath</a></td> <td></td> </tr> <tr> <td><a href="#getPythonExecutable">getPythonExecutable</a></td> <td>Function to determine the path of the (non-windowed) Python executable.</td> </tr> <tr> <td><a href="#getPythonLibPath">getPythonLibPath</a></td> <td>Function to determine the path to Python's library.</td> </tr> <tr> <td><a href="#getPythonLibraryDirectory">getPythonLibraryDirectory</a></td> <td>Function to determine the path to Python's library directory.</td> </tr> <tr> <td><a href="#getPythonScriptsDirectory">getPythonScriptsDirectory</a></td> <td>Function to determine the path to Python's scripts directory.</td> </tr> <tr> <td><a href="#getPythonVersion">getPythonVersion</a></td> <td>Function to get the Python version (major, minor) as an integer value.</td> </tr> <tr> <td><a href="#isPythonSource">isPythonSource</a></td> <td>Function to check for a Python source code file.</td> </tr> <tr> <td><a href="#searchInterpreters">searchInterpreters</a></td> <td>Function to determine a list of all Python interpreters available via the executable search path (i.e.</td> </tr> </table> <hr /> <hr /> <a NAME="__searchInterpreters_Linux" ID="__searchInterpreters_Linux"></a> <h2>__searchInterpreters_Linux</h2> <b>__searchInterpreters_Linux</b>(<i>environments=None</i>) <p> Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (non Windows variant). </p> <dl> <dt><i>environments</i> (list of str (optional))</dt> <dd> list of environment directories to scan for Python interpreters (defaults to None) </dd> </dl> <dl> <dt>Return:</dt> <dd> list of found interpreter executables </dd> </dl> <dl> <dt>Return Type:</dt> <dd> list of str </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="__searchInterpreters_Windows" ID="__searchInterpreters_Windows"></a> <h2>__searchInterpreters_Windows</h2> <b>__searchInterpreters_Windows</b>(<i>environments=None</i>) <p> Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (Windows variant). </p> <dl> <dt><i>environments</i> (list of str (optional))</dt> <dd> list of environment directories to scan for Python interpreters (defaults to None) </dd> </dl> <dl> <dt>Return:</dt> <dd> list of found interpreter executables </dd> </dl> <dl> <dt>Return Type:</dt> <dd> list of str </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="getExePath" ID="getExePath"></a> <h2>getExePath</h2> <b>getExePath</b>(<i>branch, access, versionStr</i>) <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="getPythonExecutable" ID="getPythonExecutable"></a> <h2>getPythonExecutable</h2> <b>getPythonExecutable</b>(<i></i>) <p> Function to determine the path of the (non-windowed) Python executable. </p> <dl> <dt>Return:</dt> <dd> path of the Python executable </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="getPythonLibPath" ID="getPythonLibPath"></a> <h2>getPythonLibPath</h2> <b>getPythonLibPath</b>(<i></i>) <p> Function to determine the path to Python's library. </p> <dl> <dt>Return:</dt> <dd> path to the Python library </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="getPythonLibraryDirectory" ID="getPythonLibraryDirectory"></a> <h2>getPythonLibraryDirectory</h2> <b>getPythonLibraryDirectory</b>(<i></i>) <p> Function to determine the path to Python's library directory. </p> <dl> <dt>Return:</dt> <dd> path to the Python library directory </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="getPythonScriptsDirectory" ID="getPythonScriptsDirectory"></a> <h2>getPythonScriptsDirectory</h2> <b>getPythonScriptsDirectory</b>(<i></i>) <p> Function to determine the path to Python's scripts directory. </p> <dl> <dt>Return:</dt> <dd> path to the Python scripts directory </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="getPythonVersion" ID="getPythonVersion"></a> <h2>getPythonVersion</h2> <b>getPythonVersion</b>(<i></i>) <p> Function to get the Python version (major, minor) as an integer value. </p> <dl> <dt>Return:</dt> <dd> integer representing major and minor version number </dd> </dl> <dl> <dt>Return Type:</dt> <dd> int </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="isPythonSource" ID="isPythonSource"></a> <h2>isPythonSource</h2> <b>isPythonSource</b>(<i>filename, source, editor=None</i>) <p> Function to check for a Python source code file. </p> <dl> <dt><i>filename</i> (str)</dt> <dd> name of the file with extension </dd> <dt><i>source</i> (str)</dt> <dd> of the file </dd> <dt><i>editor</i> (Editor (optional))</dt> <dd> reference to the editor, if the file is opened already (defaults to None) </dd> </dl> <dl> <dt>Return:</dt> <dd> flag indicating Python source code </dd> </dl> <dl> <dt>Return Type:</dt> <dd> bool </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="searchInterpreters" ID="searchInterpreters"></a> <h2>searchInterpreters</h2> <b>searchInterpreters</b>(<i>environments=None</i>) <p> Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (Windows variant). </p> <dl> <dt><i>environments</i> (list of str (optional))</dt> <dd> list of environment directories to scan for Python interpreters (defaults to None) </dd> </dl> <dl> <dt>Return:</dt> <dd> list of found interpreter executables </dd> </dl> <dl> <dt>Return Type:</dt> <dd> list of str </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>