0

I would like to obtain, within a python script, the value "pps" that the shell command "gpsmon" display in the terminal. I tried to capture the output of the command with this code:

import subprocess as sb

def gps_output(command):
    output = sb.run(command, stdout=sb.PIPE, stderr=sb.PIPE, shell=True)
    return output.stdout

print(gps_output('gpsmon'))

But the result is the following: b' '

0 Answers0