Hi everybody.
How can i creat e text file to use as a database in python?
I want to save my project's data changes into hard disk. What should i do?
Niloofar24 15 Posting Whiz
Recommended Answers
Jump to PostModule pickle is made for this ...
''' pickle_list101.py use module pickle to dump and load a list object use binary file modes "wb" and "rb" to make it work with Python2 and Python3 ''' import pickle mylist = [ 'Frank', 'Paul', 'Mary'] fname = "list101.pkl" # …
Jump to PostYou can store it in any folder you want, as long as you give it the full path name. For convenience, I would keep the code .py file and the data file in one folder.
Jump to PostA test with dataset,database as simple as it get.
So here i have a player list that i store in a Sqlite(comes with Python) database.import dataset player_lst = [ …
All 12 Replies
sneekula 969 Nearly a Posting Maven
Traevel 216 Light Poster
Niloofar24 15 Posting Whiz
Gribouillis 1,391 Programming Explorer Team Colleague
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Niloofar24 15 Posting Whiz
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
snippsat 661 Master Poster
Gribouillis commented: cool link +14
Gribouillis 1,391 Programming Explorer Team Colleague
snippsat 661 Master Poster
Lardmeister 461 Posting Virtuoso
snippsat 661 Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.