e480 specs test

This commit is contained in:
Nils Kasulke
2020-04-14 18:06:24 +02:00
parent 2581df87b7
commit 28736901c2
2 changed files with 34 additions and 0 deletions

34
add_system.py Normal file
View File

@@ -0,0 +1,34 @@
from subprocess import check_output
from os import name as os_name
def os_info():
if os_name == 'nt':
return command_to_string(['ver'])
else:
return command_to_string(['uname', '-a'])
def cpu_info():
if os_name == 'nt':
return command_to_string(['powershell', 'Get-WmiObject', '-class', 'win32_processor'])
else:
return read_file("/proc/cpuinfo")
def mem_info():
if os_name == 'nt':
return command_to_string(['powershell', 'Get-WmiObject', '-class', 'win32_Physicalmemory'])
else:
return read_file("/proc/mem")
def command_to_string(command):
return check_output(command, shell=True).decode("UTF-8")
def read_file(fileName):
with open(fileName) as f:
return f.read()
cpu = cpu_info()
os = os_info()
mem = mem_info()
print(os)
print(cpu)
print(mem)

BIN
e480.txt Normal file

Binary file not shown.