How to store data in a python application for later use?? Example...If user inputs an information (say user id) and logins in that app...It should automatically get login if the user closes and opens the app again...It should not ask for login again... How is this done in Python??
Answers
Answered by
2
Answer:
You can make a database and save them, the only way is this. A database with SQLITE or a .txt file. For example:
with open("mylist.txt","w") as f: #in write mode
f.write("{}".format(mylist))
Your list goes into the format() function. It'll make a .txt file named mylist and will save your list data into it.
After that, when you want to access your data again, you can do:
with open("mylist.txt") as f: #in read mode, not in write mode, careful
rd=f.readlines()
print (rd)
Similar questions