Complete with quizzes, exercises, and helpful illustrations, this easy-to-follow, self-paced tutorial gets you started with both Python 2.7 and 3.3— the latest releases in the 3.X and 2.X lines—plus all other releases in common use today. You’ll also learn some advanced language features that recently have become more common in Python code.
Mark Lutz is a leading Python trainer, the author of Python’s earliest and best-selling texts, and a pioneering figure in the Python world.
Mark is the author of the three O’Reilly books: Learning Python, Programming Python, and Python Pocket Reference, all currently in fourth or fifth editions. He has been using and promoting Python since 1992, started writing Python books in 1995, and began teaching Python classes in 1997. As of Spring 2013, Mark has instructed 260 Python training sessions, taught roughly 4,000 students in live classes, and written Python books that have sold 400,000 units and been translated to at least a dozen languages.
Together, his two decades of Python efforts have helped to establish it as one of the most widely used programming languages in the world today. In addition, Mark has been in the software field for 30 years. He holds BS and MS degrees in computer science from the University of Wisconsin where he explored implementations of the Prolog language, and over his career has worked as a professional software developer on compilers, programming tools, scripting applications, and assorted client/server systems.
Mark maintains a training website (http://learning-python.com) and an additional book support site on the Web (http://www.rmi.net/~lutz).
Python 3 is the best version of the language yet: It is more powerful, convenient, consistent, and expressive than ever before. Now, leading Python programmer Mark Summerfield demonstrates how to write code that takes full advantage of Python 3’s features and idioms. Programming in Python 3, Second Edition, brings together all the knowledge you need to write any program, use any standard or third-party Python 3 library, and create new library modules of your own.
Summerfield draws on his many years of Python experience to share deep insights into Python 3 development you won’t find anywhere else. He begins by illuminating Python’s “beautiful heart”: the eight key elements of Python you need to write robust, high-performance programs. Building on these core elements, he introduces new topics designed to strengthen your practical expertise–one concept and hands-on example at a time. Coverage includesDeveloping in Python using procedural, objectoriented, and functional programming paradigms Creating custom packages and modules Writing and reading binary, text, and XML files, including optional compression, random access, and text and XML parsing Leveraging advanced data types, collections, control structures, and functions Spreading program workloads across multiple processes and threads Programming SQL databases and key—value DBM files Debugging techniques–and using Test Driven Development to avoid bugs in the first place Utilizing Python’s regular expression mini-language and module Parsing techniques, including how to use the third-party PyParsing and PLY modules Building usable, efficient, GUI-based applications Advanced programming techniques, including generators, function and class decorators, context managers, descriptors, abstract base classes, metaclasses, coroutines, and more
Programming in Python 3, Second Edition, serves as both tutorial and language reference. It assumes some prior programming experience, and it is accompanied by extensive downloadable example code–all of it tested with Python 3 on Windows, Linux, and Mac OS X.
Tkinter is a lightweight, portable, and easy-to-use graphical toolkit available in the Python Standard Library, widely used to build Python GUIs due to its simplicity and availability. This book teaches you to design and build graphical user interfaces that are functional, appealing, and user-friendly using the powerful combination of Python and Tkinter.
After being introduced to Tkinter, you will be guided step-by-step through the application development process. Over the course of the book, your application will evolve from a simple data-entry form to a complex data management and visualization tool while maintaining a clean and robust design. In addition to building the GUI, you'll learn how to connect to external databases and network resources, test your code to avoid errors, and maximize performance using asynchronous programming. You'll make the most of Tkinter's cross-platform availability by learning how to maintain compatibility, mimic platform-native look and feel, and build executables for deployment across popular computing platforms.
By the end of this book, you will have the skills and confidence to design and build powerful high-end GUI applications to solve real-world problems.What you will learn Implement the tools provided by Tkinter to design beautiful GUIs Discover cross-platform development through minor customizations in your existing application Visualize graphs in real time as data comes in using Tkinter's animation capabilities Use PostgreSQL authentication to ensure data security for your application Write unit tests to avoid regressions when updating codeWho this book is for
This book will appeal to developers and programmers who would like to build GUI-based applications. Knowledge of Python is a prerequisite.
<li>Basic file input and output operations, incuding exceptions
<li>Using functions to compute and returnÿ multiple values
<li>Basic elements of a class definition and how to call methods
<li>Lists, dictionaries, sets, and other collections
<li>Iteration through collections, files, sorted sets
<li>Searching strings with regular expressions (regex)
<li>Client and server programs forÿREST methods
<li>Using threadsÿin Python for multiple tasks
<li>CGI-BIN programmingÿfor simple HTML Forms processing
<li>Six most common Python pitfalls
Take the One Hour challenge and see if you too can pick up 90% of syntax and semantics in less time than you probably spend commuting each day.
About the AuthorÿVictor R. Volkman graduatedÿcum laudeÿfrom Michigan Technological University with a BS in Computer Science in 1986. Since then, he has written for numerous publications, includingÿThe C Gazette, C++ Users Journal, Windows Developers Journal,ÿand many others. He has taught college-level programming courses at Washtenaw Community College and has served on its Computer Information Science (CIS) Faculty Advisory Board for more than a decade. Volkman says Python helped him "rediscover the joy of programming again."
FromÿModern Software Press
Written by Mark Lutz—widely recognized as the world’s leading Python trainer—Python Pocket Reference is an ideal companion to O’Reilly’s classic Python tutorials, Learning Python and Programming Python, also written by Mark.
This fifth edition covers:Built-in object types, including numbers, lists, dictionaries, and moreStatements and syntax for creating and processing objectsFunctions and modules for structuring and reusing codePython’s object-oriented programming toolsBuilt-in functions, exceptions, and attributesSpecial operator overloading methodsWidely used standard library modules and extensionsCommand-line options and development toolsPython idioms and hintsThe Python SQL Database API
Inside, you’ll find complete recipes for more than a dozen topics, covering the core Python language as well as tasks common to a wide variety of application domains. Each recipe contains code samples you can use in your projects right away, along with a discussion about how and why the solution works.
Topics include:Data Structures and AlgorithmsStrings and TextNumbers, Dates, and TimesIterators and GeneratorsFiles and I/OData Encoding and ProcessingFunctionsClasses and ObjectsMetaprogrammingModules and PackagesNetwork and Web ProgrammingConcurrencyUtility Scripting and System AdministrationTesting, Debugging, and ExceptionsC Extensions
You'll learn language syntax and programming techniques in a clear and concise manner, with lots of examples that illustrate both correct usage and common idioms. Completely updated for version 3.x, Programming Python also delves into the language as a software development tool, with many code examples scaled specifically for that purpose.
Topics include:Quick Python tour: Build a simple demo that includes data representation, object-oriented programming, object persistence, GUIs, and website basicsSystem programming: Explore system interface tools and techniques for command-line scripting, processing files and folders, running programs in parallel, and moreGUI programming: Learn to use Python’s tkinter widget libraryInternet programming: Access client-side network protocols and email tools, use CGI scripts, and learn website implementation techniquesMore ways to apply Python: Implement data structures, parse text-based information, interface with databases, and extend and embed Python
Many experienced programmers try to bend Python to fit patterns they learned from other languages, and never discover Python features outside of their experience. With this book, those Python programmers will thoroughly learn how to become proficient in Python 3.
This book covers:Python data model: understand how special methods are the key to the consistent behavior of objectsData structures: take full advantage of built-in types, and understand the text vs bytes duality in the Unicode ageFunctions as objects: view Python functions as first-class objects, and understand how this affects popular design patternsObject-oriented idioms: build classes by learning about references, mutability, interfaces, operator overloading, and multiple inheritanceControl flow: leverage context managers, generators, coroutines, and concurrency with the concurrent.futures and asyncio packagesMetaprogramming: understand how properties, attribute descriptors, class decorators, and metaclasses work
You’ll gain a strong foundation in the language, including best practices for testing, debugging, code reuse, and other development tips. This book also shows you how to use Python for applications in business, science, and the arts, using various Python tools and open source packages.Learn simple data types, and basic math and text operationsUse data-wrangling techniques with Python’s built-in data structuresExplore Python code structure, including the use of functionsWrite large programs in Python, with modules and packagesDive into objects, classes, and other object-oriented featuresExamine storage from flat files to relational databases and NoSQLUse Python to build web clients, servers, APIs, and servicesManage system tasks such as programs, processes, and threadsUnderstand the basics of concurrency and network programming