The Python Tkinter filedialog module offers you a set of unique dialogs to be used when dealing with files. Tkinter has a wide variety of different dialogs, but the ones in filedialog are specifically designed for file selection. And as expected of dialog boxes, these are done in a very user friendly manner.

Below is a list of all the different Dialog options available. Make sure to import filedialog from tkinter as we have shown below. If you want to use tkinter as well as filedialog (which you most definitely will) you will have to import tkinter separately.

from tkinter import filedialog
filedialog.asksaveasfilename()
filedialog.asksaveasfile()
filedialog.askopenfilename()
filedialog.askopenfile()
filedialog.askdirectory()
filedialog.askopenfilenames()
filedialog.askopenfiles()
Ezoic report this ad
Subscribe