how to load all save file?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By potatobanana

how can i load all save file if it exist then fill it in array

save file name
var save_data_name = ["save_1","save_2","save_3","save_4","save_5","save_6","save_7"]
slot that need to fill var player_dict = [{},{},{},{},{},{},{}]

example if save_1 and save_3 exist,
if will fill like this var player_dict = [{dict_1},{},{dict_2},{},{},{},{}]

:bust_in_silhouette: Reply From: reshadiye1

i will write a way which came to my mind:

var player_dict = []
for name  in save_data_name:
      player_dict.append({"dict_" + str(name[-1]) :   name) 

name[-1] will give last character of name, 1, 2 etc…

#after this will append that name to array as dictionary.
Example if you have save_1 and save_4, then player_dict will be like this:

{dict_1 : “save_1”,dict_4 : “save_4”}

i hope it will help you.