Download pool/shard007/Python/0062769_WriteToScreenv0_13.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/Python/0062769_WriteToScreenv0_13.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard007/Python/0062769_WriteToScreenv0_13.py
-
curl -L -o 0062769_WriteToScreenv0_13.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/Python/0062769_WriteToScreenv0_13.py
1.48 kB
| #!/usr/bin/python | |
| # requires RPi_I2C_driver.py | |
| import RPi_I2C_driver | |
| from time import * | |
| import os | |
| import subprocess | |
| proc = subprocess.Popen(["tail -n 1 /opt/data/temphumidity.csv | cut -d , -f 2 | cut -d \\\" " + "-f 2"], stdout=subprocess.PIPE, shell=True) | |
| (out, err) = proc.communicate() | |
| #print "program output:", out | |
| roomtemp = out.strip() | |
| proc = subprocess.Popen(["tail -n 1 /opt/data/temphumidity.csv | cut -d , -f 4 | cut -d \\\" " + "-f 2"], stdout=subprocess.PIPE, shell=True) | |
| (out, err) = proc.communicate() | |
| #print "program output:", out | |
| roomhumidity = out.strip() | |
| proc = subprocess.Popen(["tail -n 1 /opt/data/temphumidityOWM.csv | cut -d , -f 2 | cut -d \\\" " + "-f 2"], stdout=subprocess.PIPE, shell=True) | |
| (out, err) = proc.communicate() | |
| #print "program output:", out | |
| outsidetemp = out.strip() | |
| proc = subprocess.Popen(["tail -n 1 /opt/data/temphumidityOWM.csv | cut -d , -f 4 | cut -d \\\" " + "-f 2"], stdout=subprocess.PIPE, shell=True) | |
| (out, err) = proc.communicate() | |
| #print "program output:", out | |
| outsidehumidity = out.strip() | |
| cmd = "sudo rmmod i2c_bcm2708; sudo modprobe i2c_bcm2708;" | |
| os.system(cmd) | |
| sleep (2) | |
| mylcd = RPi_I2C_driver.lcd() | |
| mylcd.lcd_display_string("RmTemp %s DegC" %roomtemp, 1) | |
| mylcd.lcd_display_string("RmHumidity %s Pcnt" %roomhumidity, 2) | |
| mylcd.lcd_display_string("OutTemp %s DegC" %outsidetemp, 3) | |
| mylcd.lcd_display_string("OutHumidity %s Pcnt" %outsidehumidity, 4) | |
| sleep(5) # 5 sec delay | |
| mylcd.lcd_clear() | |
| mylcd.backlight(0) | |