Using Python is there any way to find out the processor information... (I need the name)
I need the name of the processor that the interpreter is running on. I check
For Linux, and backwards compatibility with Python (not everyone has cpuinfo), you can parse through /proc/cpuinfo directly. To get the processor speed, try:
# Take any float trailing "MHz", some whitespace, and a colon.
speeds = re.search("MHz\s*: (\d+\.?\d*)", cpuinfo_content)
Note the necessary use of \s for whitespace.../proc/cpuinfo actually has tab characters and I toiled for hours working with sed until I came up with:
sed -rn 's/cpu MHz[ \t]*: ([0-9]+\.?[0-9]*)/\1/gp' /proc/cpuinfo
I lacked the \t and it drove me mad because I either matched the whole file or nothing.
Try similar regular expressions for the other fields you need:
# Take any string after the specified field name and colon.
re.search("field name\s*: (.+)", cpuinfo_content)