pyqy QSettings读取计算机\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\{D7426EC2-F67A-42AF-B86E-04A33A0C00E2}}_is1
时间: 2024-12-10 15:48:46 浏览: 4
pyqy简易视频播放器
在PyQt中,如果你想从计算机的`HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall`路径下读取特定软件的信息,比如`{D7426EC2-F67A-42AF-B86E-04A33A0C00E2}_is1`这个键值,你可以按照以下步骤操作:
```python
from PyQt5.QtCore import QSettings
# 初始化QSettings实例,选择注册表作为数据源
registry = QSettings(QSettings.RegistryFormat, QSettings.UserScope)
# 定义完整的键路径
key_path = r"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\{D7426EC2-F67A-42AF-B86E-04A33A0C00E2}"
is1_key = "_is1"
# 访问该键
if registry.contains(key_path + '\\' + is1_key):
installed = registry.value(key_path + '\\' + is1_key)
print(f"Is the software with ID '{is1_key}' installed? {installed}")
else:
print(f"No installation information found for key '{key_path}\\{is1_key}'.")
阅读全文