[Tutor] Which should it be, lists, tuples, dictionary or files?
beachkidken at gmail.com
Tue Jan 3 01:31:22 CET 2012
On 01/02/2012 05:47 PM, Steven D'Aprano wrote:
> Ken G. wrote:
>> I have been using an Open Office Spreadsheet containing basically,
>> the food name, basic serving amount, calories, sodium and
>> carbohydrate. Daily, I entered the servicing amount being eaten and
>> its calculate the amount of calories, sodium and carbohydrate. For
>> some odd reason, I kept losing the spreadsheet and its data.
>> I am interested in keeping track of the number of calories consumed
>> each day. Due to losing the spreadsheet data so frequencies, I
>> decided to use Python in keeping track of the basic information and
>> perhaps, keep track of the calories in a file.
> If you lose the spreadsheets, what makes you think you won't lose the
> Python files?
I am using Open Office and for unknown reason, it does not always open.
I am on Ubuntu 10.04.3 OS. I use my Python files every day.
>> Should the above five elements be stored as a list, tuples,
>> dictionary or file? I am will familiar with files and have some
>> knowledge of using lists and tuples. Not too familiar with dictionary.
> 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
> "INI file format" and see if it sounds like what you could use.
Okay, thanks. I will look into it. Have not heard of INI file format.
More information about the Tutor