[Tutor] Reading a file and best approach for it...

Spencer Parker sjpark at rondaandspencer.info
Fri Apr 10 16:50:14 CEST 2009

I have a flat file database that I want to get information from.  The basic
text looks like this:

ITEM    {
        "FULLNAME"      "apps114.chgit.com!file:/etc"
        "RECOVERY"      "0"

They are all on a separate line in the text file.  I had thought about
trying to drop it into a list or a dictionary.  Most likely a dictionary.
What would be the best practice to get this into a dictionary?  I had
thought about using regular expressions to pull the data I need.  Just not
totally sure how to approach this for the most part.  Not looking for
solutions just ideas on how to approach the problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090410/1f9e594d/attachment.htm>

More information about the Tutor mailing list