Python Forum

Full Version: Python, Tkinter. How to search a specific file in a folder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everybody!!
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.
It's difficult at best to determine what's needed without seeing code.
I'm guessing you want to import GUI script in second script so that you have access to it's methods.
Hi! I haven't put any script because I don't have it yet. Basically want to have two separate programs: one that works as a GUI where I can insert all the details and the program write and save a text file with all the details that I have inserted. This program is already done. Now I would like to write a second GUI that allows me to have a search widget bar where I can recall one of those text file previously created using as a key word for the search the title of the file. At the moment I have to write from scratch the second GUI but I can't find the way to create such a "search widget".
so if gui program is named gui.py
and second program is named processdata.py
in processdata.py, add line:
import gui
You will then be able to access methods from gui.py in processdata.py as gui.methodname