+ 2
How to store user input in python.
Hello guys...i have been creating a python program whereby its like a library management system.But i have a problem with storing the data I get from the user. For example the user inputs the book number, Author, book title, the name of student who was issued the book.i need to properly store the data so that it can be accessed easily an changed it when needed. I have tried storing in files but python stores it as tuples which aint behaving well
4 odpowiedzi
+ 4
From my experience a dict for storing informations is a good option. saving this to a file i would recommend json format. i did a try some weeks ago : https://code.sololearn.com/c6i2Xq4DJvx5/?ref=app
+ 2
Presuming you don't want to use a data base, I would suggest using csv-files.
https://docs.python.org/3/library/csv.html