I'm creating a simple program with data about users. I have a txt file which store RANDOMLY generated users and their progress during one month. In this method I'm filling the txt file and also adding the same info to list.
def runBase(mylist):
mylist = []
for day in range(1, 32):
BASE.write('DAY ' + str(day) + '\n' + '\n')
dayinfo = updateUsersData()
#adding dayingo to list
mylist.append(dayinfo)
#adding dayinfo to txt file
BASE.write(tabulate(toString(dayinfo), headers=HEADERS) + '\n' + '\n')
Here are results for txt file: results for txt file
Every user has different values for steps time and food fields.
And here what I have in the list (this values are always the same). The issue is NOT in printing: results for the list
So every time I generate new list with users, I get the list with last generated list of users. I tried different ways to fill the list, but I it's always the same problem.
Aucun commentaire:
Enregistrer un commentaire