todo = [('Applications\\python.exe\\shell\\open\\command',
    '"PYDIR\\python.exe" "%1" %*'), (
    'Applications\\pythonw.exe\\shell\\open\\command',
    '"PYDIR\\pythonw.exe" "%1" %*'), ('Python.CompiledFile\\DefaultIcon',
    'PYDIR\\pyc.ico'), ('Python.CompiledFile\\shell\\open\\command',
    '"PYDIR\\python.exe" "%1" %*'), ('Python.File\\DefaultIcon',
    'PYDIR\\py.ico'), ('Python.File\\shell\\open\\command',
    '"PYDIR\\python.exe" "%1" %*'), ('Python.NoConFile\\DefaultIcon',
    'PYDIR\\py.ico'), ('Python.NoConFile\\shell\\open\\command',
    '"PYDIR\\pythonw.exe" "%1" %*')]
classes_root = reg.OpenKey(reg.HKEY_CLASSES_ROOT, '')
for path, value in todo:
    pass
Python: WindowsError при редактировании значений реестра с помощью _winreg в Windows 7