Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # @author: __zero__
- from tkinter import *
- from tkinter import filedialog, ttk
- def openFile():
- f = filedialog.askopenfilename(
- filetypes=[('Config Files (CFG)', '.cfg'),('All files (*.*)', '.*')]
- )
- msg = "Sucess >> %s" % f if len(f) > 0 else "Error"
- path.set(msg)
- print(msg)
- root = Tk()
- root.geometry("300x60")
- root.resizable(0, 0)
- root.title("files..")
- path = StringVar()
- Label(text="FILE_PATH$", textvariable=path).pack()
- search = ttk.Button(text="Search file", command=lambda: openFile() ).pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment