Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I ended up adapting a script (<a href="http://effbot.org/zone/python-register.htm" rel="noreferrer">http://effbot.org/zone/python-register.htm</a>) to register a Python installation in the registry. I can pick the Python to be <em>the</em> Python in the registry, run the Windows installer, then set the registry back:</p> <pre><code># -*- encoding: utf-8 -*- # # script to register Python 2.0 or later for use with win32all # and other extensions that require Python registry settings # # Adapted by Ned Batchelder from a script # written by Joakim Löw for Secret Labs AB / PythonWare # # source: # http://www.pythonware.com/products/works/articles/regpy20.htm import sys from _winreg import * # tweak as necessary version = sys.version[:3] installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version) installkey = "InstallPath" pythonkey = "PythonPath" pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % ( installpath, installpath, installpath ) def RegisterPy(): try: reg = OpenKey(HKEY_LOCAL_MACHINE, regpath) except EnvironmentError: try: reg = CreateKey(HKEY_LOCAL_MACHINE, regpath) except Exception, e: print "*** Unable to register: %s" % e return SetValue(reg, installkey, REG_SZ, installpath) SetValue(reg, pythonkey, REG_SZ, pythonpath) CloseKey(reg) print "--- Python %s at %s is now registered!" % (version, installpath) if __name__ == "__main__": RegisterPy() </code></pre> <p>Run this script with the Python you want to be registered, and it will be entered into the registry. Note that on Windows 7 and Vista, you'll need Administrator privileges.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload