appending key-value pairs to a dict
James Stroud
jstroud at mbi.ucla.edu
Fri May 20 16:20:48 EDT 2005
On Friday 20 May 2005 01:04 pm, rbt wrote:
> I know how to setup an empty list and loop thru something... appending
> to the list on each loop... how does this work with dicts?
>
> I'm looping thru a list of files and I want to put the file's name and
> its sha hash into a dict on each loop.
>
> Many thanks,
>
> rbt
Simple assignment.
adict[filename] = an_sha_hash
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
More information about the Python-list
mailing list