Explorar el Código

Bug convert to str before writing dict

Foppe Hemminga hace 6 años
padre
commit
b605773933
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      main.py

+ 2 - 2
main.py

@@ -85,9 +85,9 @@ if __name__ == '__main__':
 
                 # We just sent an alert
                 temp_status_json['alert'][str(minutes_to_go)] = True
-                print(temp_status_json)
+                temp_status_json_to_write = json.dumps(temp_status_json, indent=2)
                 write_file = open(f'status-{player_id}.json', 'w')
-                write_file.write(temp_status_json)
+                write_file.write(temp_status_json_to_write)
                 write_file.close()
                 write_file.close()