Hi guys, i have to parse need string. Here is command I execute in Linux console:
amixer get Master |grep Mono:
And get, for example,
Mono: Playback 61 [95%] [-3.00dB] [on]
Then i test it from python-console:
import re,os
print re.search( ur"(?<=\[)[0-9]{1,3}", u" Mono: Playback 61 [95%] [-3.00dB] [on]" ).group()[0]
And get result: 95. It's that, what i need. But if I'll change my script to this:
print re.search( ur"(?<=\[)[0-9]{1,3}", str(os.system("amixer get Master |grep Mono:")) ).group()[0]
It'll returns None-object. Why?