The goal for this iteration is to implement the functionality of the File menu options: 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.
Here's an example of a typical filedialog:
Tkinter defines the following common use cases for filedialogs:
Functions | Description |
askopenfile | This returns the opened file object |
askopenfilename | This returns the filename string, not the opened file object |
askopenfilenames | This returns a list of filenames |
askopenfiles | This returns a list of open file objects or an empty list if Cancel is selected |
asksaveasfile | This asks for a filename to save as and returns the opened file object |
asksaveasfilename | This asks for... |