Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Tkinter GUI Application Development Blueprints

You're reading from  Tkinter GUI Application Development Blueprints

Product type Book
Published in Nov 2015
Publisher Packt
ISBN-13 9781785889738
Pages 340 pages
Edition 1st Edition
Languages
Author (1):
Bhaskar Chaudhary Bhaskar Chaudhary
Profile icon Bhaskar Chaudhary

Table of Contents (15) Chapters

Tkinter GUI Application Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Meet Tkinter 2. Making a Text Editor 3. Programmable Drum Machine 4. A Game of Chess 5. Building an Audio Player 6. Paint Application 7. Multiple Fun Projects 8. Miscellaneous Tips Index

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.

Example of filedialog

A quick look at the source code shows the following functions for our use:

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}

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 a filename...