J. Burton Browning
Oak Island, NC, USA
Marty Alchin
Agoura Hills, CA, USA
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/9781484243848 . For more detailed information, please visit http://www.apress.com/source-code .
ISBN 978-1-4842-4384-8 e-ISBN 978-1-4842-4385-5
https://doi.org/10.1007/978-1-4842-4385-5
Library of Congress Control Number: 2019936454
J. Burton Browning and Marty Alchin 2019
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Introduction
This third edition expands on Martys original work. Found in each chapter of this third edition are useful libraries that any Python programmer will find of value. Use what you learn for your own projects and enjoyment!
J. Burton Browning
When I wrote my first book, Pro Django , I didnt have much of an idea what my readers would find interesting. I had gained a lot of information I thought would be useful for others to learn, but I didnt really know what would be the most valuable thing theyd take away. As it turned out, in nearly 300 pages, the most popular chapter in the book barely mentioned Django at all. It was about Python.
The response was overwhelming. There was clearly a desire to learn more about how to go from a simple Python application to a detailed framework like Django. Its all Python code, but it can be hard to understand based on even a reasonably thorough understanding of the language. The tools and techniques involved require some extra knowledge that you might not run into in general use.
This gave me a new goal with
Pro Python : to take you from proficient to professional. Being a true professional requires more experience than you can get from a book, but I want to at least give you the tools youll need. Combined with the rich philosophy of the Python community, youll find plenty of information to take your code to the next level.
Marty Alchin
Who This Book Is For
The goal is to bring intermediate programmers to a more advanced level; we wrote this book with the expectation that youll already be familiar with Python on some basic level. You should be comfortable using the interactive interpreter, writing control structures, and [using] a basic object-oriented approach.
Thats not a very difficult prerequisite. If youve tried your hand at writing a Python applicationeven if you havent released it into the wild, or even finished ityou likely have all the necessary knowledge to get started. The rest of the information youll need is contained in these pages.
Acknowledgments
This third edition covers some exciting library features available in the Python 3 language. Try the samples and expand on your own projects with what you learn. Do not be afraid to experiment and have fun!
J. Burton Browning
I wouldnt have even started this project if not for the endless encouragement from my lovely wife, Angel. Shes been my sounding board, my task manager, my copyeditor, and my own personal cheerleader. Theres no way I could do anything like this without her help and support.
Id also like to thank my technical reviewer, George, for everything hes done to help me out. Hes gone above and beyond the limits of his role, helping with everything from code to grammar and even a good bit of style. After enjoying his help on Pro Django , I wouldnt have even signed on for another book without him by my side.
Lastly, I never wouldve considered a book like this if not for the wonderful community around Python. The willingness of Python programmers to open their minds and their code is, I believe, unrivaled among our peers. Its this spirit of openness that encourages me every day, leading me to discover new things and push myself beyond the limits of what I knew yesterday.
We learn by doing and by seeing what others have done. I hope that youll take the contents of this book and do more with it than what Ive done. Theres no better reward for all this hard work than to see better programmers writing better code.
Marty Alchin
Table of Contents
About the Authors and About the Technical Reviewer
About the Authors
J. Burton Browning
earned his doctorate from North Carolina State University. He has conducted research in areas including distance learning, programming, and instructional technology. As a lifelong learner and someone who has interests in topics such as programming, photography, robotics, car restoration, woodworking, hunting, reading, fishing, and archery, he is never at a loss for something to do. The art and joy of serving as a professor suits his inquisitive nature. Dr. Brownings previous publications include works on Cross-Functional Learning Teams (CFLT), the Utopian School (teacher-led school model), computer programming (several languages), open-source software, healthcare statistics and data mining, CNC plasma cutter operation, educational technology, biography, mobile learning, online teaching, and more.
Marty Alchin
By day, Marty Alchin works as a senior software engineer at Heroku, and after that, he writes and codes for fun and community. His blog can be found at http://martyalchin.com and he has profiles on many other services under the name Gulopine. In particular, his code can be found on GitHub and his random thoughts are on Twitter. He also accepts tips for his open source work at https://gittip.com/gulopine .