Opening Files Directory in TKinter and Python - Python Tutorial (2020) #15

Published: 15 June 2020
on channel: Anshuman Biswal
8,951
77

Python Tkinter (and TK) offer a set of dialogs that you can use when working with files. By using these you don’t have to design standard dialogs your self. Example dialogs include an open file dialog, a save file dialog and many others. Besides file dialogs there are other standard dialogs, but in this article we will focus on file dialogs.

File dialogs help you open, save files or directories. This is the type of dialog you get when you click file,open. This dialog comes out of the module, there’s no need to write all the code manually.

Tkinter does not have a native looking file dialog, instead it has the customer tk style. You can see these below.

The file dialog will work on all desktop platforms.

import tkinter.filedialog

tkinter.filedialog.asksaveasfilename()
tkinter.filedialog.asksaveasfile()
tkinter.filedialog.askopenfilename()
tkinter.filedialog.askopenfile()
tkinter.filedialog.askdirectory()
tkinter.filedialog.askopenfilenames()
tkinter.filedialog.askopenfiles()

#python2020 #tkintergui #madaboutpython #tkintertutorial #tkinterprojects #tkinterinpython #tkinterguitutorial


On this page of the site you can watch the video online Opening Files Directory in TKinter and Python - Python Tutorial (2020) #15 with a duration of hours minute second in good quality, which was uploaded by the user Anshuman Biswal 15 June 2020, share the link with friends and acquaintances, this video has already been watched 8,951 times on youtube and it was liked by 77 viewers. Enjoy your viewing!