Hi,
the code below should return UP but it returns DOWN and I cannot understand why.
any help is appreciated.
TIA
Nevermind. I had white spaces in line.
the code below should return UP but it returns DOWN and I cannot understand why.
any help is appreciated.
TIA
from __future__ import print_function import subprocess _cmd = 'grep RUNNING /proc/asound/card*/pcm*/sub*/status' cmd = 'cat /proc/asound/card*/pcm*/sub*/status | grep state:' p = subprocess.check_output(cmd,shell=True).decode("utf-8") print(p) #prints state: RUNNING if (p=='state: RUNNING'): print('UP') else: print('DOWN')
Nevermind. I had white spaces in line.