Phill Atwood wrote:
[...]
> So how do I add a dictionary into a list by value rather than
> by reference?
Is rec.items() what you want? It returns a list of (key, value)
tuples.
> The complete code is here:
[...]
Looks like you could use Python's ConfigParser module.
http://docs.python
"Phill Atwood" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> def csv_it():
> db = [] # the entire database of records
> rec = {} # a single rec: a dictionary of field names and data pairs
Move this line
> fields = [] # list of field names collected so far for curren
Phill Atwood wrote:
> Newbie question:
>
> I have a dictionary called "rec". And a list called "db". db is my
> database. rec are to be records in the database. In a loop I'm trying to
> create a record and add it to my database. The key stmt is
>
> db.append( rec )
>
> This works initially
Newbie question:
I have a dictionary called "rec". And a list called "db". db is my
database. rec are to be records in the database. In a loop I'm trying to
create a record and add it to my database. The key stmt is
db.append( rec )
This works initially but it seems that instead of copying