refactor
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import subprocess, re
|
||||
|
||||
def getCpuInfo():
|
||||
command = "cat /proc/cpuinfo"
|
||||
all_info = subprocess.check_output(command, shell=True).strip()
|
||||
for line in all_info.split("\n"):
|
||||
if "model name" in line:
|
||||
return re.sub( ".*model name.*:", "", line,1)
|
||||
Reference in New Issue
Block a user