def __get_registry_key(self, key):
        """ Read currency from windows registry """
        import winreg

        root = winreg.OpenKey(
            winreg.HKEY_CURRENT_USER, r'SOFTWARE\GSettings\org\gnucash\general', 0, winreg.KEY_READ)
        [pathname, regtype] = (winreg.QueryValueEx(root, key))
        winreg.CloseKey(root)
        return pathname
Read currency from windows registry