Oohhh, so that was it!
I needed to create another variable to handle the file modification.
With your help, I've managed to make it work!
Finally! The program now works!
I can now proceed with Tkinter. Hope I don't face such little problems hehe
Again, thank you very much!
P.S.: Just for the info, I needed to edit the file creation to instead of creating 1,2,3,4..., create 01,02,03..., otherwise when I reserve the seat 5, it would break the 15th seat, by renaming it to 1R5 hehe.
Code:
try:
reservation=open("reservation.pycine", "r+", encoding="utf-8")
reservation.close()
except IOError:
reservation=open("reservation.pycine", "w+", encoding="utf-8")
for seats in range (1,17):
reservation.write("%02d\n" % seats)
reservation.close()
Bookmarks