You should be able to execute rtl_433
as a subprocess using the subprocess module. Normally you would just use subprocess.run
, but since rtl_433
produces output until it is killed, you will need to use subprocess.Popen
and parse the output.
Another option is to pipe the output of rtl_433
to your program and using input()
or sys.stdin.readline()
to read lines. Like rtl_433 -flags | python3 script.py
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…