diff --git a/add_system.py b/add_system.py new file mode 100644 index 0000000..cd314f6 --- /dev/null +++ b/add_system.py @@ -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) diff --git a/e480.txt b/e480.txt new file mode 100644 index 0000000..e989b9f Binary files /dev/null and b/e480.txt differ