I have built a loop in a function for a text file, but the file should take the data from a textfile1 to an textfile2
the textfile 1 is grabbing data and always refreshing initial data
textfile 2 is grabbing data from textfile 1 for new jobs . //: normally textfile1 = textfile 2 (row and data) but more the loop is running and more i have difference between those two file
could you help with my loop issue?
def compteur3():
evaluation_eleves = []
infile = open('eleve.txt', 'r+')
timeout = True
while not timeout:
for user in users:
evaluation_eleves.append([user['id'],user['note'])
print(evaluation_eleves)
with open("classe1.txt", "w") as text_file:
for i in evaluation_eleves:
print(i, file=text_file)
f = open('classe1', 'r+')
r = open('eleve.txt', 'r+')
text = f.read()
f.seek(0)
r.write(text)
f.truncate()
f.close()
compteur3()