# If you know the name of the key, you can also evaluate it directly
Name, value, type = _winreg.EnumValue(key, i) #EnumValue Method to enumerate key values, EnumKey Used to enumerate child keys # Gets all of the key values for the key, and because there is no way to get the number of key values, it is the only way to iterate Key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,r'Software\Microsoft\Windows\CurrentVersion\Explorer') You can refer to the official reference document: Here I mainly give some Demo codes for _winreg and win32api. Another option is the win32api module for Win32 Extension For Python, but requires additional installation. The first is through Python's built-in module _winreg.
There are two ways to manipulate the registry through Python.