1from tkinter import *
2import os
3
4# window
5window = Tk()
6window.geometry("450x450")
7window.title("Gui App")
8window.configure(bg="powder blue")
9
10# Enter or user input in tkinter
11filename = Entry(window, width=75)
12filename.pack()
13
14# Run file Function
15
16def runFile():
17 try:
18 os.startfile(filename.get())
19
20 except:
21 error = Label(window, text=f"No file found as {filename.get}")
22 error.pack()
23
24 # Run file button
25open_file_button = Button(window, text="Run File", command=runFile)
26open_file_button.pack()
27
28window.mainloop()
29