#!/usr/bin/env python3
+# Desc: Prints time and temperature reading
+# Output: [date (ISO-8601)],[date (Unix Epoch)],[temp (°C)]
+# Depends: python 3.3
+# Ref/Attrib: Raspberry Pi Temprature Sensor using the DS18B20; https://pimylifeup.com/raspberry-pi-temperature-sensor/
import os
import glob
nowTimeIso8601 = strftime("%Y%m%dT%H%M%S%z")
nowTimeUE = strftime("%s")
nowTemp = read_temp()
- print(str(nowTimeIso8601) + ',' + str(nowTimeUE) + ',' + str(myHostname) + ',' + str(nowTemp))
+ print(str(nowTimeIso8601) + ',' + str(nowTimeUE) + ',' + str(myHostname) + ',' + str(nowTemp), flush=True) # flush to stdout continuously (e.g. without buffer) https://stackoverflow.com/a/14729823
time.sleep(1)