import commands freq = commands.getoutput("cat /proc/cpuinfo | grep \"cpu MHz\") freq2 = commands.getoutput("cat /proc/cpuinfo | grep \"cpu MHz\")[11:] print freq print freq2