From 28736901c2e148975b6c65774f4503fe1fe569dd Mon Sep 17 00:00:00 2001 From: Nils Kasulke Date: Tue, 14 Apr 2020 18:06:24 +0200 Subject: [PATCH] e480 specs test --- add_system.py | 34 ++++++++++++++++++++++++++++++++++ e480.txt | Bin 0 -> 4222 bytes 2 files changed, 34 insertions(+) create mode 100644 add_system.py create mode 100644 e480.txt 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 0000000000000000000000000000000000000000..e989b9f010403b5940d41d7052b7f3757e15788c GIT binary patch literal 4222 zcmbW4Yfl?T6o${|O8pO3KBZDYzJyC7RVvs?aDt8NB~(?ZkYfz7vIb-fltlgOZJ&3> z!(M$U8tu;R?7Zhb=bZibpYQEE)77!D4Q*=IcFT2PGppEdtXh2><>G!5qoY~ zzvfHDYF4#Pchzjy8n$h9-gmfH?N3KH(9h3J8`uq80;LMn^5ZotZTQUK8bkXP?{C3P zK*jdR+csARSFYOq6X=Q9%wgLS*a}_OvwiWw@=NewzX8oNV*w-ii(OljU zy32-&gG;m<@E-gq{vU~iHz~P;{OinTb_Uls)`dz0t;Iu}>QAx>*R(_11GO6GBfA0q z3?F|cmZZxNO=9dbBEn>^#|-rdiF!!ZU&=>PHSu}pe^74O@8~PZk9k_8ahkG^!~xb< z)I?5xostRi#coyv&NA}%`F4l~dvG~e%4J>aY(hyg{A@1@R@Avn>{ua|USy={VaKDn zJ*Bn0cZ7wz&`c~Kot0HWs~sf>S3q?{7{WAwVuovBsv;^~UgDPy^Wr={Fp&+E+U)A-zY+e5z@ zyvO#5tgLgQYF0L+N0M*%iS8@%^C9ymP;n_nbcEZ-(p|ixSP#DNRZi7n3}02OMMD&J z$;G?&6Qe;L+hR`g+dB2q(-x&9X1}P2|5q&~z#c1v`RnT4N8u%<)^(m<&;yXaIK4Z>^d8p-o*SH)eV#X%)w>0~LOkVT zM>6!0;o)g#K%}iD)Psv%bznze!mj+BM)g6cx4cKAMd!-n^Qarni0X)P