[Tutor] Searching through text

Alex Kleider akleider at sonic.net
Mon Nov 18 14:59:32 EST 2019


On 2019-11-18 03:23, samhar zghaier wrote:
....
> I thought that i would start by storing my books in a text file that 
> will
> look something like this
> Book name, writer, number (to make choosing a bit easier)

It seems you are going to use a csv file as your data base.
The Python csv library might be something that could prove useful to 
you.
If you change the above line to
"""
book_name,writer,number
"""
and make it the first line in your file
then:
csv.DictReader might prove especially useful.
https://docs.python.org/3/library/csv.html

It will also let you look at your data using open/libreOffice (or the 
MicroSoft equivalent.)


More information about the Tutor mailing list