增加windows 实现

This commit is contained in:
simonchuzz 2023-10-13 22:15:59 +08:00
parent 4a4d042c41
commit 300b01ade0

View File

@ -206,9 +206,11 @@ def get_cpu_info():
pass
elif os_type == OSType.WINDOWS:
try:
output = subprocess.check_output('wmic cpu get Name', shell=True).decode("utf-8")
output = subprocess.check_output("wmic cpu get Name", shell=True).decode(
"utf-8"
)
lines = output.splitlines()
cpu_info = lines[2].split(':')[-1].strip()
cpu_info = lines[2].split(":")[-1].strip()
except:
pass