ebook img

Tkinter GUI Application Development HOTSHOT PDF

362 Pages·2013·3.01 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Tkinter GUI Application Development HOTSHOT

Tkinter GUI Application Development H TSHOT Develop exciting and engaging GUI applications in Python and Tkinter by working on 10 real-world applications Bhaskar Chaudhary BIRMINGHAM - MUMBAI Tkinter GUI Application Development H TSHOT Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: October 2013 Production Reference: 1211013 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84969-794-1 www.packtpub.com Cover Image by Manu Gangadhar ([email protected]) Credits Author Project Coordinator Bhaskar Chaudhary Angel Jathanna Reviewers Proofreaders Ankur Aggarwal Simran Bhogal Mike Driscoll Maria Gould Anshuman Pandey Alejandro Rodas de Paz Indexer Rekha Nair Acquisition Editor Pramila Balan Graphics Abhinash Sahu Lead Technical Editor Chalini Snega Victor Production Coordinators Alwin Roy Nitesh Thakur Technical Editors Jalasha D'costa Dipika Gaonkar Cover Work Nitesh Thakur Kapil Hemnani Akashdeep Kundu Mrunmayee Patil About the Author Bhaskar Chaudhary is a professional programmer and information architect. He has almost 9 years of consulting, contracting, and educating experience in the field of software development. He has worked with a large set of programming languages on various platforms over the years. He is an electronics hobbyist and musician in his free time. I would like to thank my parents for everything that they have done for me. Thanks to my wife Sangita who provided valuable support at every stage of writing of this book. Thanks to my friend Souvik, sisters Priyanki and Shambhavi, and nephew Praneet and niece Aakansha for being around. Anurag you are always remembered and a source of inspiration. I would like to thank Angel Jathanna, the Project Coordinator, for her timely input and feedback during the course of writing. I'd also like to thank Pramila Balan, the Acquisition Editor, and Chalini Snega Victor, the Lead Technical Editor, for making several helpful suggestions with regard to the book's structure, technical accuracy, and quality control. Thanks to Reshma Raman, the Author Relations Executive for getting me involved in the project. I would also like to thank my reviewers Alejandro Rodas for providing countless suggestions to improve the code, Michael Driscoll for pointing out otherwise unnoticeable errors, Anshuman for testing out programs and pointing errors, and Ankur Aggarwal for providing suggestions for making the book more reader friendly. Finally thanks to the Python community for being such a supportive group and to entire team at Packt Publishing, for publishing great books in the open source domain. About the Reviewers Ankur Aggarwal is currently working in the Education and Research department of Infosys Limited. He loves to play with Unix and Linux tools. He has created various automation tools using Python, PHP, and is learning Linux Kernel Development. He is also an author of various international magazines and portals such as Open Source For You (previously Linux For You), Ubuntumanual.org, and Richnusgeek. He runs a Linux based blog too on www.flossstuff.wordpress.com. He loves coding and listening to metal music. He is a die hard fan of Iron Maiden and loves playing the guitar in his free time. Mike Driscoll has been programming in Python since Spring 2006. He enjoys writing about Python on his blog: http://www.blog.pythonlibrary.org/. He also occasionally writes for the Python Software Foundation, i-Programmer, and Developer Zone. He enjoys photography and reading a good book. Mike has also been a technical reviewer for Python 3 Object Oriented Programming, Python 2.6 Graphics Cookbook, and the Python Web Development Beginner's Guide among others. I would like to thank my wonderful wife, Evangeline, for always supporting me. I would also like to thank friends and family for all that they do to help me. And I would like to thank Jesus Christ for saving me. Anshuman Pandey holds a Bachelor's Degree in Technology in Computer Science and Engineering. Being a software developer, he is always eager to learn and build upon new technologies. He is also an avid blogger, endurance runner, and tennis enthusiast. Currently employed as an Analyst at a software consulting firm, Anshuman has extensive hands on experience with data analysis and programming. He picked up Python by himself as an undergraduate, and has since worked on a variety of Python projects as well as reviewed books on the subject. Being enthusiastic about sharing ideas and collaborating with like-minded individuals, Anshuman is an up-and-coming blogger. He manages his own website "Twisted Thoughts", where he shares his thoughts on everything from cool new technologies and nifty software tricks to tennis and life lessons. His blog has proved to be a good portal to network with young professionals with similar interests. I would like to thank my parents for being supportive in my first venture as a book reviewer, my band of friends for encouraging me, and Packt Publishing for giving me the wonderful opportunity to review this book. Alejandro Rodas de Paz is a Computer Engineer from the University of Seville (Spain). He started programming in Python for artificial intelligence and data mining projects, and discovered Tkinter as an easy and effective way to develop GUI applications. He worked at research institutions such as the Web Engineering and Early Testing group, and the MediaLAB Amsterdam. I would like to thank my grandmother Crescencia for her unconditional support, trust, and love during all my life. www.PacktPub.com Support files, eBooks, discount offers, and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? f Fully searchable across every book published by Packt f Copy and paste, print and bookmark content f On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Table of Contents Preface 1 Project 1: Meet Tkinter 7 Mission Briefing 7 The root window – your drawing board 10 Widgets – building blocks for your GUI program 13 Getting to know core Tkinter widgets 16 Geometry management 19 Events and callbacks – adding life to programs 28 Doing it in style 36 Mission Accomplished 41 A Hotshot Challenge 42 Project 2: Making a Text Editor like Notepad 43 Mission Briefing 43 Setting up the widgets 45 Leveraging the power of built-in Text widget options 51 Indexing and tagging 52 Working with forms and dialogs 59 Working with message boxes 64 The icon toolbar and View menu functions 67 Event handling and the context menu 74 Mission Accomplished 76 A Hotshot Challenge 76

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.