Python:_winreg type name
Python winreg
For value types: How do I query _winreg.REG_BINARY for ‘REG_BINARY‘ ? I can do it by hand:
import _winregreg_type_str = { _winreg.REG_BINARY: ‘REG_BINARY‘, _winreg.REG_DWORD: ‘REG_DWORD‘, _winreg.REG_DWORD_LITTLE_ENDIAN: ‘REG_DWORD_LITTLE_ENDIAN‘, _winreg.REG_DWORD_BIG_ENDIAN: ‘REG_DWORD_BIG_ENDIAN‘, _winreg.REG_EXPAND_SZ: ‘REG_EXPAND_SZ‘, _winreg.REG_LINK: ‘REG_LINK‘, _winreg.REG_MULTI_SZ: ‘REG_MULTI_SZ‘, _winreg.REG_NONE: ‘REG_NONE‘, _winreg.REG_RESOURCE_LIST: ‘REG_RESOURCE_LIST‘, _winreg.REG_FULL_RESOURCE_DESCRIPTOR: ‘REG_FULL_RESOURCE_DESCRIPTOR‘, _winreg.REG_RESOURCE_REQUIREMENTS_LIST: ‘REG_RESOURCE_REQUIREMENTS_LIST‘, _winreg.REG_SZ: ‘REG_SZ‘,}reg_type_str.get(_winreg.REG_SZ)
Of course there's a better way. What I want to do ... For example, query:
reg_data, reg_type = _winreg.QueryValueEx(key, reg_value)log.debug("Query: %s [%d:%s]" % (reg_data, reg_type, reg_type_str.get(reg_type)))
I think I should be able to do this:
>>> for k, v in _winreg.__dict__:... if v == _winreg.REG_SZ:... print kTraceback (most recent call last): File "<pyshell#468>", line 1, in <module> for k, v in _winreg.__dict__:ValueError: too many values to unpack
Of course, this does not work, but even if it will be with the _winreg problem:
>>> for v in _winreg.__dict__.itervalues():... if v == _winreg.REG_SZ:... print v111111
This address: codego.net/8986958/
--------------------------------------------------------------------------------------------------------------- ----------
1. I have arrived, I need to do, the original question is provided. The only way to solve this problem is if the _winreg developer provides a function
Article title: Python:_winreg type name
This address: codego.net/8986958/
Go Python:_winreg type name