def update_time_max_temp_label(): min_temperat, dt_min_temperat, max_temperat, dt_max_temperat = extrema.get_extrema( last_n_hours=MIN_MAX_TIME_RANGE) time_max_temp_label['bg'] = update_bg_color('0') time_max_temp_label['text'] = "{:>15s}".format(dt_max_temperat) time_max_temp_label.after(5000, update_time_max_temp_label)
log_file = os.path.join(data_log_dir, log_filename) print(data_log_dir) print(log_file) log_header = create_header(log_file) with open(log_file, "a") as log: log.write(log_header) dt = datetime.now() log.write("{},{},{},{}\n".format(dt, bucha_temp, min, max)) log.close() ##### MAIN PROGRAM ##### try: min_temperat, dt_min_temperat, max_temperat, dt_max_temperat = extrema.get_extrema( last_n_hours=MIN_MAX_TIME_RANGE) #will the function "log_buch_temp() see the following variables?" min = min_temperat max = max_temperat print("min:" + str(min)) print("max:" + str(max)) except: print("get_extrema could not find min/max") while True: #bucha_temp = read_temp() bucha_temp = read_fake_temp() addNum(bucha_temp) min = getMin()