database
Terry Reedy
tjreedy at udel.edu
Thu Jul 15 18:33:10 EDT 1999
More information about the Python-list mailing list
Thu Jul 15 18:33:10 EDT 1999
- Previous message (by thread): database
- Next message (by thread): python, tkInter -> tcl/tk problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <3787c551.1 at ganymede.datanet.hu>, granadam at mail.datanet.hu says... >i am new to python....... > >i have a database (comma separated text), and i would like to get some data >out of it based on some query. let's say there are seven fields, f1...f7, >and i am searching for entries in f1, and want to display f1..f7 for the >field that matches the query. how do i go about doing that? After reading in lines with readline() or readlines(), use string.splitfields(line,',') to split each line (this assumes that you do not have ,s embedded within quoted strings -- which is why people sometimes use something obscure like '|' as a field separator). Then use == comparison or one of the string search functions to test f1. Terry J. Reedy
- Previous message (by thread): database
- Next message (by thread): python, tkInter -> tcl/tk problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list