Basically, don't - it'll only cause you grief.
When the registry was first created, it was pretty much public, anyone could stick anything in it. And so they did - it got bloated, slow, and unreliable so access became restricted, and each successive version of the OS added restrictions. It seems that this trend towards a totally secure registry will continue.
Instead, there are folders in Windows that are specifically there to hold user data such as INI files (though XML / JSON is generally considered a better idea these days):
Special folder - Wikipedia[
^]
You can get the path to these at run time either via
win32com.SHGetFolderPath
:
from win32com.shell import shell, shellcon
print shell.SHGetFolderPath(0, shellcon.CSIDL_PERSONAL, None, 0)
or by using a python wrapper like
userpaths · PyPI[
^] (Google can find you several different such wrappers).