/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def enum_types(mimedb): i = 0 while True: try: ctype = _winreg.EnumKey(mimedb, i) except EnvironmentError: break try: ctype = ctype.encode(default_encoding) # omit in 3.x! except UnicodeError: pass else: yield ctype i += 1