lot_manager/device.py

6 lines
199 B
Python
Raw Normal View History

2023-12-09 15:16:51 +08:00
import subprocess
2023-12-09 15:25:38 +08:00
p = subprocess.Popen(['cat /home/pi/device_name'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
device_name = out.decode('utf-8').strip()