E
E
enabl32018-03-13 16:04:18
Python
enabl3, 2018-03-13 16:04:18

How to find data in a file?

Hello.
There is a bot written in python.
And there is a file that contains data about people, full name and phone number, the data goes line by line.
How to format the code correctly so that by writing a bot just a first or last name, it would send matches in response?
I edit the text like this:

@bot.message_handler(content_types=['text'])
def text_msg(message):

And how to make the search not take into account the case of letters.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fixid, 2018-03-13
@enabl3

Open file
Read line by line
Find matches and write to buffer
Return data from buffer It
is difficult to answer your question specifically

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question