Setiawan <stwn at unsoed.ac.id> Code (2) [...] def sensor_read(): humi, temp = dht.read_retry(sensor, pin) if humi is not None and temp is not None: print("Temperature: {0:0.1f}*C Humidity: {1:0.1f}%".format(temp, humi)) else: print("Cannot read data from the sensor") return humi, temp def cloud_send(): send_req = urllib.request.urlopen(API_WREQ + '{0}&field1={1:0.1f}&field2={2:0.1f}'\ .format(API_WKEY, temp, humi)) [...] iot-d2c.py