5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.SystemUtilities.PythonUtilities</h1> |
9 <h1>eric7.SystemUtilities.PythonUtilities</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing Python related utility functions. |
11 Module implementing Python related utility functions. |
13 </p> |
12 </p> |
|
13 |
14 <h3>Global Attributes</h3> |
14 <h3>Global Attributes</h3> |
15 |
|
16 <table> |
15 <table> |
17 <tr><td>None</td></tr> |
16 <tr><td>None</td></tr> |
18 </table> |
17 </table> |
|
18 |
19 <h3>Classes</h3> |
19 <h3>Classes</h3> |
20 |
|
21 <table> |
20 <table> |
22 <tr><td>None</td></tr> |
21 <tr><td>None</td></tr> |
23 </table> |
22 </table> |
|
23 |
24 <h3>Functions</h3> |
24 <h3>Functions</h3> |
25 |
|
26 <table> |
25 <table> |
27 |
|
28 <tr> |
26 <tr> |
29 <td><a href="#__searchInterpreters_Linux">__searchInterpreters_Linux</a></td> |
27 <td><a href="#__searchInterpreters_Linux">__searchInterpreters_Linux</a></td> |
30 <td>Function to determine a list of all Python interpreters available via the executable search path (i.e.</td> |
28 <td>Function to determine a list of all Python interpreters available via the executable search path (i.e.</td> |
31 </tr> |
29 </tr> |
32 <tr> |
30 <tr> |
64 <tr> |
62 <tr> |
65 <td><a href="#searchInterpreters">searchInterpreters</a></td> |
63 <td><a href="#searchInterpreters">searchInterpreters</a></td> |
66 <td>Function to determine a list of all Python interpreters available via the executable search path (i.e.</td> |
64 <td>Function to determine a list of all Python interpreters available via the executable search path (i.e.</td> |
67 </tr> |
65 </tr> |
68 </table> |
66 </table> |
|
67 |
69 <hr /> |
68 <hr /> |
70 <hr /> |
69 <hr /> |
71 <a NAME="__searchInterpreters_Linux" ID="__searchInterpreters_Linux"></a> |
70 <a NAME="__searchInterpreters_Linux" ID="__searchInterpreters_Linux"></a> |
72 <h2>__searchInterpreters_Linux</h2> |
71 <h2>__searchInterpreters_Linux</h2> |
73 <b>__searchInterpreters_Linux</b>(<i>environments=None</i>) |
72 <b>__searchInterpreters_Linux</b>(<i>environments=None</i>) |
74 |
|
75 <p> |
73 <p> |
76 Function to determine a list of all Python interpreters available via the |
74 Function to determine a list of all Python interpreters available via the |
77 executable search path (i.e. PATH) (non Windows variant). |
75 executable search path (i.e. PATH) (non Windows variant). |
78 </p> |
76 </p> |
|
77 |
79 <dl> |
78 <dl> |
80 |
79 |
81 <dt><i>environments</i> (list of str (optional))</dt> |
80 <dt><i>environments</i> (list of str (optional))</dt> |
82 <dd> |
81 <dd> |
83 list of environment directories to scan for Python interpreters |
82 list of environment directories to scan for Python interpreters |
100 <hr /> |
99 <hr /> |
101 <hr /> |
100 <hr /> |
102 <a NAME="__searchInterpreters_Windows" ID="__searchInterpreters_Windows"></a> |
101 <a NAME="__searchInterpreters_Windows" ID="__searchInterpreters_Windows"></a> |
103 <h2>__searchInterpreters_Windows</h2> |
102 <h2>__searchInterpreters_Windows</h2> |
104 <b>__searchInterpreters_Windows</b>(<i>environments=None</i>) |
103 <b>__searchInterpreters_Windows</b>(<i>environments=None</i>) |
105 |
|
106 <p> |
104 <p> |
107 Function to determine a list of all Python interpreters available via the |
105 Function to determine a list of all Python interpreters available via the |
108 executable search path (i.e. PATH) (Windows variant). |
106 executable search path (i.e. PATH) (Windows variant). |
109 </p> |
107 </p> |
|
108 |
110 <dl> |
109 <dl> |
111 |
110 |
112 <dt><i>environments</i> (list of str (optional))</dt> |
111 <dt><i>environments</i> (list of str (optional))</dt> |
113 <dd> |
112 <dd> |
114 list of environment directories to scan for Python interpreters |
113 list of environment directories to scan for Python interpreters |
131 <hr /> |
130 <hr /> |
132 <hr /> |
131 <hr /> |
133 <a NAME="determinePythonVersion" ID="determinePythonVersion"></a> |
132 <a NAME="determinePythonVersion" ID="determinePythonVersion"></a> |
134 <h2>determinePythonVersion</h2> |
133 <h2>determinePythonVersion</h2> |
135 <b>determinePythonVersion</b>(<i>filename, source, editor=None</i>) |
134 <b>determinePythonVersion</b>(<i>filename, source, editor=None</i>) |
136 |
|
137 <p> |
135 <p> |
138 Function to determine the python version of a given file. |
136 Function to determine the python version of a given file. |
139 </p> |
137 </p> |
|
138 |
140 <dl> |
139 <dl> |
141 |
140 |
142 <dt><i>filename</i> (str)</dt> |
141 <dt><i>filename</i> (str)</dt> |
143 <dd> |
142 <dd> |
144 name of the file with extension |
143 name of the file with extension |
175 <hr /> |
174 <hr /> |
176 <hr /> |
175 <hr /> |
177 <a NAME="getPythonExecutable" ID="getPythonExecutable"></a> |
176 <a NAME="getPythonExecutable" ID="getPythonExecutable"></a> |
178 <h2>getPythonExecutable</h2> |
177 <h2>getPythonExecutable</h2> |
179 <b>getPythonExecutable</b>(<i></i>) |
178 <b>getPythonExecutable</b>(<i></i>) |
180 |
|
181 <p> |
179 <p> |
182 Function to determine the path of the (non-windowed) Python executable. |
180 Function to determine the path of the (non-windowed) Python executable. |
183 </p> |
181 </p> |
|
182 |
184 <dl> |
183 <dl> |
185 <dt>Return:</dt> |
184 <dt>Return:</dt> |
186 <dd> |
185 <dd> |
187 path of the Python executable |
186 path of the Python executable |
188 </dd> |
187 </dd> |
197 <hr /> |
196 <hr /> |
198 <hr /> |
197 <hr /> |
199 <a NAME="getPythonLibPath" ID="getPythonLibPath"></a> |
198 <a NAME="getPythonLibPath" ID="getPythonLibPath"></a> |
200 <h2>getPythonLibPath</h2> |
199 <h2>getPythonLibPath</h2> |
201 <b>getPythonLibPath</b>(<i></i>) |
200 <b>getPythonLibPath</b>(<i></i>) |
202 |
|
203 <p> |
201 <p> |
204 Function to determine the path to Python's library. |
202 Function to determine the path to Python's library. |
205 </p> |
203 </p> |
|
204 |
206 <dl> |
205 <dl> |
207 <dt>Return:</dt> |
206 <dt>Return:</dt> |
208 <dd> |
207 <dd> |
209 path to the Python library |
208 path to the Python library |
210 </dd> |
209 </dd> |
219 <hr /> |
218 <hr /> |
220 <hr /> |
219 <hr /> |
221 <a NAME="getPythonLibraryDirectory" ID="getPythonLibraryDirectory"></a> |
220 <a NAME="getPythonLibraryDirectory" ID="getPythonLibraryDirectory"></a> |
222 <h2>getPythonLibraryDirectory</h2> |
221 <h2>getPythonLibraryDirectory</h2> |
223 <b>getPythonLibraryDirectory</b>(<i></i>) |
222 <b>getPythonLibraryDirectory</b>(<i></i>) |
224 |
|
225 <p> |
223 <p> |
226 Function to determine the path to Python's library directory. |
224 Function to determine the path to Python's library directory. |
227 </p> |
225 </p> |
|
226 |
228 <dl> |
227 <dl> |
229 <dt>Return:</dt> |
228 <dt>Return:</dt> |
230 <dd> |
229 <dd> |
231 path to the Python library directory |
230 path to the Python library directory |
232 </dd> |
231 </dd> |
241 <hr /> |
240 <hr /> |
242 <hr /> |
241 <hr /> |
243 <a NAME="getPythonScriptsDirectory" ID="getPythonScriptsDirectory"></a> |
242 <a NAME="getPythonScriptsDirectory" ID="getPythonScriptsDirectory"></a> |
244 <h2>getPythonScriptsDirectory</h2> |
243 <h2>getPythonScriptsDirectory</h2> |
245 <b>getPythonScriptsDirectory</b>(<i></i>) |
244 <b>getPythonScriptsDirectory</b>(<i></i>) |
246 |
|
247 <p> |
245 <p> |
248 Function to determine the path to Python's scripts directory. |
246 Function to determine the path to Python's scripts directory. |
249 </p> |
247 </p> |
|
248 |
250 <dl> |
249 <dl> |
251 <dt>Return:</dt> |
250 <dt>Return:</dt> |
252 <dd> |
251 <dd> |
253 path to the Python scripts directory |
252 path to the Python scripts directory |
254 </dd> |
253 </dd> |
263 <hr /> |
262 <hr /> |
264 <hr /> |
263 <hr /> |
265 <a NAME="getPythonVersion" ID="getPythonVersion"></a> |
264 <a NAME="getPythonVersion" ID="getPythonVersion"></a> |
266 <h2>getPythonVersion</h2> |
265 <h2>getPythonVersion</h2> |
267 <b>getPythonVersion</b>(<i></i>) |
266 <b>getPythonVersion</b>(<i></i>) |
268 |
|
269 <p> |
267 <p> |
270 Function to get the Python version (major, minor) as an integer value. |
268 Function to get the Python version (major, minor) as an integer value. |
271 </p> |
269 </p> |
|
270 |
272 <dl> |
271 <dl> |
273 <dt>Return:</dt> |
272 <dt>Return:</dt> |
274 <dd> |
273 <dd> |
275 integer representing major and minor version number |
274 integer representing major and minor version number |
276 </dd> |
275 </dd> |
285 <hr /> |
284 <hr /> |
286 <hr /> |
285 <hr /> |
287 <a NAME="searchInterpreters" ID="searchInterpreters"></a> |
286 <a NAME="searchInterpreters" ID="searchInterpreters"></a> |
288 <h2>searchInterpreters</h2> |
287 <h2>searchInterpreters</h2> |
289 <b>searchInterpreters</b>(<i>environments=None</i>) |
288 <b>searchInterpreters</b>(<i>environments=None</i>) |
290 |
|
291 <p> |
289 <p> |
292 Function to determine a list of all Python interpreters available via the |
290 Function to determine a list of all Python interpreters available via the |
293 executable search path (i.e. PATH) (Windows variant). |
291 executable search path (i.e. PATH) (Windows variant). |
294 </p> |
292 </p> |
|
293 |
295 <dl> |
294 <dl> |
296 |
295 |
297 <dt><i>environments</i> (list of str (optional))</dt> |
296 <dt><i>environments</i> (list of str (optional))</dt> |
298 <dd> |
297 <dd> |
299 list of environment directories to scan for Python interpreters |
298 list of environment directories to scan for Python interpreters |