python獲取軟體安裝列表2222

2021-09-06 18:19:34 字數 1401 閱讀 1018

softer_installed_list ********************=

使用python編寫的,獲取本機軟體安裝列表,輸出為html**.

* win7 32位環境下執行

* 使用的是"**software\microsoft\windows\currentversion\uninstall**"

下的軟體安裝列表

* 生成檔案儲存為index.html

* gitbhub位址為:

* 執行不需要引數,雙擊softer_installed_list.py即可.(需要安裝python2.x)

主要**:

```python key = _winreg.openkey(_winreg.hkey_local_machine, r"software\microsoft\windows\currentversion\uninstall", 0, _winreg.key_all_access) for i in xrange(0, _winreg.queryinfokey(key)[0]-1): try: key_name_under_uninstall=_winreg.enumkey(key, i) #print key_name_under_uninstall each_key_path="software\microsoft\windows\currentversion\uninstall"+'\\'+ key_name_under_uninstall #print each_key_path each_key= _winreg.openkey(_winreg.hkey_local_machine,each_key_path,0, _winreg.key_all_access) try: softer_ware_name,typeresult= _winreg.queryvalueex(each_key,"displayname") softer_ware_name=softer_ware_name.encode('utf-8')

try: installlocation_name,typeresult= _winreg.queryvalueex(each_key,"installlocation") installlocation_name = installlocation_name.encode('utf-8') if installlocation_name=="": installlocation_name="null" except windowserror: installlocation_name="null" html_table = html_table + html_tr_left_str + str(i+1) + '''''' + softer_ware_name + '''''' + installlocation_name + html_tr_right_str except windowserror: pass except windowserror: pass

python 庫列表 python庫安裝列表

1.sudo apt get install python setuptools安裝setuptools setuptools 可以自動的安裝模組,只需要你提供給它乙個模組名字就可以了,並且自動幫你解決模組的依賴問題。一般情況下用setuptools安裝的模組會自動放到乙個字尾是.egg的目錄裡。s...

電腦軟體推薦安裝列表

本篇博文記錄常用好用的軟體,會不定時更新。1.好壓 官網 2.android studio 中文官網 英文官網 3.vpn express 官網 4.github 官網 5.git 官網 6.chrome 瀏覽器 推薦理由 程式設計師圈子中最好用的瀏覽器 英文官網 7.intellij idea 官...

Python獲取excel列表資料

import xlrd import time 設定路徑 file path r c users viruser.v desktop desktop worlddata finds.xlsx utf 8編碼 xlrd.book.encoding utf 8 獲取資料 data xlrd.open w...