Working with forms and dialogs
The goal for this iteration is to implement the functionality of the File menu options of Open, Save, and Save As.
We can implement these dialogs by using the standard Tkinter widgets. However, since these are so commonly used, a specific Tkinter module called filedialog
has been included in the standard Tkinter distribution.
The source code of the filedialog
module can be found within the Tkinter source code in a separate file named filedialog.py
.
A quick look at the source code shows the following functions for our use:
Functions |
Description |
---|---|
|
This returns the opened file object |
|
This returns the filename string, not the opened file object |
|
This returns a list of filenames |
|
This returns a list of open file objects or an empty list if |
|
This asks for a filename to save as and returns the opened file object |
|
This asks for a filename... |