Syntax for running shell command in Python
Posted: Thu Feb 07, 2019 12:33 pm
Hi All
I would like to run the shell command;
... which runs perfectly in the terminal, within a Python script, assigning that to a variable for subsequent
I tried the above (obtained from elsewhere) but the result returned is not what I expected, which is;.
b"temp=52.6'C/n"
Could someone offer some advice please, many thanks.
I would like to run the shell command;
Code: Select all
vcgencmd measure_temp Code: Select all
cpu_temp = subprocess.check_output("vcgencmd measure_temp", shell=True)
b"temp=52.6'C/n"
Could someone offer some advice please, many thanks.