I need a sample program that will put the current CPU MHz in a variable with python. I prefer a short compact program. Thanks in advance.
1 Answer
This is four lines, but here it is anyways. Probably isn't the best way, though. (oh, and in your script remember to use the shebang for python3)
from os import popen
str=popen("vcgencmd measure_clock arm").read()
str = str[str.find("=")+1:-7]
print(str)