Tkinter tkFileDialog module
Tkinter tkFileDialog module
tkFileDialog is a module with open and save dialog functions.
Instead of implementing those in Tkinter GUI on your own.
Instead of implementing those in Tkinter GUI on your own.
Overview
An overview of file dialogs:
An overview of file dialogs:
Function | Parameters | Purpose |
---|---|---|
.askopenfilename | Directory, Title, Extension | To open file: Dialog that requests selection of an existing file. |
.asksaveasfilename | Directory, Title, Extension) | To save file: Dialog that requests creation or replacement of a file. |
.askdirectory | None | To open directory |
Tkinter Open File
The askopenfilename function to creates an file dialog object. The extensions are shown in the bottom of the form (Files of type). The code below will simply show the dialog and return the filename. If a user presses cancel the filename is empty. On a Windows machine change the initialdir to “C:\”.
Python 2.7 version:
Python 3 version:
Here is an example (on Linux):
Tkinter Save File
The asksaveasfilename function prompts the user with a save file dialog.
Python 2.7 version
Python 3 version
Tkinter Open Directory
The askdirectory presents the user with a popup for directory selection.
Python 2.7 version
Reference
https://pythonspot.com/tk-file-dialogs/
bimiYme-gi_1979 Matt Palma Crack
ResponderBorrartralentome