<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV></DIV>
<DIV>Hello,</DIV>
<DIV>&nbsp;</DIV>
<DIV>If it's specifically about a dictionary, try also the following:</DIV>
<DIV>import shelve</DIV>
<DIV>help(shelve)</DIV>
<DIV>&nbsp;</DIV>
<DIV>A shelve is a persistent dictionary.<BR>&nbsp;</DIV>Cheers!!<BR>Albert-Jan 
<DIV></DIV><BR><BR>
<DIV>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR>All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
<DIV><BR></DIV>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> शंतनू &lt;shantanoo@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> C.T. Matsumoto &lt;c.t.matsumoto@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> python-tutor &lt;tutor@python.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tue, December 14, 2010 9:54:00 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [Tutor] Generating a python file<BR></FONT><BR>
<DIV dir=ltr><BR><BR>
<DIV class=gmail_quote>On Tue, Dec 14, 2010 at 14:18, C.T. Matsumoto <SPAN dir=ltr>&lt;<A href="mailto:c.t.matsumoto@gmail.com" rel=nofollow target=_blank ymailto="mailto:c.t.matsumoto@gmail.com">c.t.matsumoto@gmail.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>Hello,<BR><BR>Is it possible to create files containing python code in the same sort of way that you can generate text files.<BR><BR>A simple example perhaps could be a persistent dictionary. Keys and values are written to the dictionary in a file, that can be imported later.<BR></BLOCKQUOTE>
<DIV><BR>http://docs.python.org/library/pickle.html is your friend.<BR><BR>HTH.<BR></DIV></DIV></DIV></DIV></DIV></DIV></div><br>

      </body></html>