diff --git a/device.py b/device.py index de7b687..fa05591 100644 --- a/device.py +++ b/device.py @@ -1,7 +1,5 @@ -import os import subprocess -# 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() -device_name = os.getenv('device_name').strip() +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()