磁盤的序列號對于一些應(yīng)用程序來說是非常重要的。本文將介紹Python如何獲取磁盤序列號。Python通過os模塊來獲取磁盤序列號,具體實(shí)現(xiàn)方法如下:
import wmi
c = wmi.WMI()
# # 硬盤序列號
for physical_disk in c.Win32_DiskDrive():
? ? print("硬盤序列號", physical_disk.SerialNumber)
# CPU序列號
for cpu in c.Win32_Processor():
? ? print("CPU序列號", cpu.ProcessorId.strip())
# 主板序列號
for board_id in c.Win32_BaseBoard():
? ? print("主板序列號", board_id.SerialNumber)
# mac地址
for mac in c.Win32_NetworkAdapter():
? ? print("mac地址", mac.MACAddress)文章來源:http://www.zghlxwxcb.cn/news/detail-800227.html
# bios序列號
for bios_id in c.Win32_BIOS():
? ? print("bios序列號", bios_id.SerialNumber.strip())
?文章來源地址http://www.zghlxwxcb.cn/news/detail-800227.html
到了這里,關(guān)于用python讀取硬盤序列號 CPU序列號 主板序列號 bios序列號的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!