0

I created a program using Tkinter that allows me to fill up a form with some details and write a text file to store all the details. Every file is named automatically using first and last name taken from the details inserted. I would like now to create a separate program that allows me to search in that folder a specific text file using first and last name as a key word for the search and I can't find something for this specific action. Any suggestions? Please keep in mind that I'm currently working with python 2. Thanks a lot for any help.

Py_Rog
  • 45
  • 10
  • What have you tried so far? Searching for 'python 2 search files' brings back many millions of results, surely there is plenty of help to begin with? – rrd Feb 13 '19 at 09:15
  • Hi!! I did search for it but I only found results about searching a file following a specific path or a specific extension. I'm trying to create a GUI that allows me to search for a .txt file in a specific folder using the title as a keyword for the search. I can't just figure it out how to make it work in this way. – Py_Rog Feb 16 '19 at 10:44
  • Have you tried glob or os.walk? A quick search on StackOverflow gives this result: https://stackoverflow.com/questions/2186525/use-a-glob-to-find-files-recursively-in-python – javapyscript Feb 13 '19 at 09:43
  • I saw it but I can't figure it out how to make it work in the way I need. Imagine you have a folder full of .txt files. Every file is just a list of people's details and every file is automatically named with first name and last name of the person. I'm trying to create a GUI that, inserting first name and last name would search the file with the same name and print it on screen. – Py_Rog Feb 16 '19 at 10:48

0 Answers0