Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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.
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]
Required, but never shown