[Tutor] Which should it be, lists, tuples, dictionary or files?

Alan Gauld alan.gauld at btinternet.com
Tue Jan 3 02:24:11 CET 2012


On 03/01/12 00:31, Ken G. wrote:

>> If you to store the data permanently, it has to go into a file. I
>> suggest you learn about INI files to start with. Start by googling for
> Okay, thanks. I will look into it. Have not heard of INI file format.

It's a Microsoft text file format invented for use on Windows but
in fact is applicable to any kind of data stoorage with one or
two levels of key.

Another option for you would be a shelve.(See the shelve module
in the standard library) A file that acts like a dictionary.
You can store a list of values against a single key.

Alternatively a simple SqlLite database would give you general 
searchability if that is important.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list