Просмотр исходного кода

Bug convert to str before writing dict

Foppe Hemminga 6 лет назад
Родитель
Сommit
b605773933
1 измененных файлов с 2 добавлено и 2 удалено
  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()