Current location - Education and Training Encyclopedia - Educational institution - How does python open a file with TKIntermodule?
How does python open a file with TKIntermodule?
When you say "open the FileDialog box", you need to use the FileDialog module. The code is simple:

From Tkinter import *

Import from File Dialog Box *

root = Tk()

Fd = LoadFileDialog(root) # Create an open file dialog box.

Filename = fd.go() # Displays the open file dialog box and obtains the selected file name.

Print file name

root.mainloop()