Python provides a variety of modules with the help of which one may develop GUI (Graphical User Interface) applications. Tkinter is one of the easiest and fastest way to develop GUI applications.
While working with files one may need to open files, do operations on files and after that to save file.
asksaveasfile() is the function which is used to save user’s file (extension can be set explicitly or you can set default extensions also). This function comes under the
Below is the Code:
Output #1: Directory before saving any file (folder is initially empty)
Output #2: Dialogbox when user presses the save button (dialog box to save file is opened). You may see in the output Python file as default is selected.
Output #3: Directory after saving 2 Python files (one may also change the type of file)
- Python | askopenfile() function in Tkinter
- Python | Binding function in Tkinter
- Python GUI - tkinter
- RadioButton in Tkinter | Python
- Python | after method in Tkinter
- Python | GUI Calendar using Tkinter
- Python Tkinter - Label
- Python Tkinter - SpinBox
- Python Tkinter - Message
- Different messages in Tkinter | Python
- Python Tkinter Tutorial
- Python-Tkinter Scrollbar
- Python: Age Calculator using Tkinter
- Binding Function with double click with Tkinter ListBox
- Create First GUI Application using Python-Tkinter
- Python Tkinter - Scale Widget
- Autocmplete ComboBox in Python-Tkinter
- Python | Menu widget in Tkinter
- Python | Loan calculator using Tkinter
- Color game using Tkinter in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.