Message266249
| Author |
upendra-k14 |
| Recipients |
lorenzogotuned, terry.reedy, upendra-k14 |
| Date |
2016年05月24日.13:33:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1464096824.3.0.22926896529.issue27051@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
2. Detecting different versions of Python installed :
For Windows :
It is explained in PEP 514 by Steve Dower.
Windows has registry keys which can be accessed by winreg or _winreg module.
Priority of registry keys :
HKEY_CURRENT_USER > HKEY_LOCAL_MACHINE
On 64 bit Windows there is another registry key for 32 bit programs,
HKEY_LOCAL_MACHINE\Software\Wow6432Node
Therefore using registry keys we can know about Python packages installed by enumerating on :
1. HKEY_CURRENT_USER\Software\Python\<Company>\<Tag>\<InstallPath>
2. HKEY_LOCAL_MACHINE\Software\Python\<Company>\<Tag>\<InstallPath>
3. HKEY_LOCAL_MACHINE\Wow6432Node\Python\<Company>\<Tag>\<InstallPath>
<Tag> will tell the version number of Python, and in <InstallPath> key there are two more subkeys which will tell the location of Python executable :
1. <Executable Path>
2. <WindowedExecutablePath>
For Linux :
We can find Python installations in /usr/bin/pythonXYZ
For MAC OS :
It can be searched for in
/Library/Frameworks/
/System/Library/Frameworks
If Python was installed by Homebrew :
Then the location can be in
/usr/local |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年05月24日 13:33:44 | upendra-k14 | set | recipients:
+ upendra-k14, terry.reedy, lorenzogotuned |
| 2016年05月24日 13:33:44 | upendra-k14 | set | messageid: <1464096824.3.0.22926896529.issue27051@psf.upfronthosting.co.za> |
| 2016年05月24日 13:33:44 | upendra-k14 | link | issue27051 messages |
| 2016年05月24日 13:33:44 | upendra-k14 | create |
|