| |
comp.lang.python |
I'd suggest that you download pysqlite. Then you have a small Another obvious solution, since you are saying that it's a For info in CSV handling, see http://docs.python.org/lib/module-csv.html For other non-SQL solutions, please have a look at
> I am an old time
> cobol programmer from the IBM 360/370 eria and this ingrained idea of
> file processing using file definition (FD's) I believe is causing me
> problems because I think python requires a different way of looking at
> datafiles and I haven't really gotten my brain around it yet.
> like to create a small sequential file, processing at first to store a
> group id, name, amount, and date which I can add to delete from and
> update. Could someone point me to some code that would show me how this
> is done in python. Eventually, I intend to expand my little program to
> process this file as a flat comma delimited file, move it to some type
> of indexed file and finally to some RDBMS system. My little program
> started out at about 9 lines of code and is now at about 100 with 5 or
> six functions which I will eventually change to classes (I need to
> learn OOP to but one step at a time).
diversions. In a way, an SQL database maps better to your idea
of files / records, and it just takes much less code and effort
to use SQL than to twist "normal" (for me) files into behaving
like main frame dittos.
embedded SQL database in your python program and don't need to
bother with a server. See http://initd.org/tracker/pysqlite
small file, is to always read the whole file into memory, and
to rewrite the whole file when you change things.
http://www-106.ibm.com/developerworks/library/l-pypers.html
and http://docs.python.org/lib/node77.html