code: def get_nt_7z_dir ():
      
      # Python 3.x renamed the _winreg module to winreg
      try:
          import _winreg as winreg
      except ImportError:
          import winreg
      try:
          key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\7-Zip")
          try:
              return winreg.QueryValueEx(key, "Path")[0]
          finally:
              winreg.CloseKey(key)
      except WindowsError:
          return ""
docs: Return 7-Zip directory from registry, or an empty string.