[Tutor] Writing dictionaries to a file

Jerry Hill malaclypse2 at gmail.com
Mon Apr 7 21:08:41 CEST 2008


On Mon, Apr 7, 2008 at 1:09 PM, Jerrold Prothero <jdprothero at gmail.com> wrote:
> Relevant Python 2.5 documentation sections are 9.1.1 and 9.1.4. My
> question boils down to this: what does writerows want as an argument
> for a dictionary?

A list of dictionaries. One dictionary for each row you would like to
output.  If you want to write out a single row, you can pass a single
dictionary to writerow() instead of using writerows().

-- 
Jerry


More information about the Tutor mailing list