winreg.DeleteKey(key, sub_key)
Deletes the specified key.
key is an already open key, or one of the predefined HKEY_* constants.
sub_key is a string that must be a subkey of the key identified by the key parameter. This value must not be None, and the key may not have subkeys.
This method can not delete keys with subkeys.
If the method succeeds, the entire key, including all of its values, is removed. If the method fails, an OSError exception is raised.
Changed in version 3.3: See above.