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. The first book written from a completely “Python 3” viewpoint, Programming in Python 3 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. This book’s coverage includes Developing in Python using procedural, object-oriented, 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 Utilizing Python’s regular expression mini-language and module Building usable, efficient, GUI-based applications Advanced programming techniques, including generators, function and class decorators, context managers, descriptors, abstract base classes, metaclasses, and more Programming in Python 3 serves as both tutorial and language reference, and it is accompanied by extensive downloadable example code—all of it tested with the final version of Python 3 on Windows, Linux, and Mac OS X.
Author: Mark Summerfield
Publisher: Addison-Wesley Professional
Release Date: 2010
Practical Python 3 for experienced developers: use the right idioms, techniques, and features to write great code * *Written from a completely 'Python 3' point of view: teaches best practices for making the most of today's newest version of Python. *Designed to help developers get productive fast... then learn how to write any program, use any library, create any library module. *Includes expert guidance on migrating Python 2 code to Python 3. Around the world, programmers appreciate Python for its simplicity, power, expressiveness, and the sheer pleasure of writing Python code. Python 3.1 is the newest and best version of the language yet: more convenient, more consistent, and easier to use. Mark Summerfield demonstrates how to write code that takes full advantage of the latest Python 3 features and idioms. Programming in Python 3, 2/e, brings together all the knowledge needed to write programs, use any library, and even create new library modules. The book teaches every aspect of the Python 3 language. It covers all the built-in functionality, as well as key components of Python's standard library. Structured so readers can write Python programs from chapter 1, each subsequent chapter provides further depth and broader coverage. Two new chapters have been added to this edition increasing the coverage to include parsing, debugging, testing, and profiling. Readers will master Python procedural and object-oriented techniques; creation of custom modules and packages; writing and reading files; multithreading; networking; database programming; GUIs; regular expressions; application debugging, testing, and profiling; and more. Detailed appendices include coverage of migrating applications from Python 2 to Python 3, plus a complete language reference. All sample code has been tested with the final version of Python 3 on Windows, Linux, and Mac OS X.
Author: Mark Summerfield
Publisher: Addison-Wesley Professional
Release Date: 2009-11-12
A Fully Revised Edition Featuring New Material on Coroutines, Debugging, Testing, Parsing, String Formatting, and More 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 includes Developing 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.
Author: John M. Zelle
Publisher: Franklin, Beedle & Associates, Inc.
Release Date: 2004
This book is suitable for use in a university-level first course in computing (CS1), as well as the increasingly popular course known as CS0. It is difficult for many students to master basic concepts in computer science and programming. A large portion of the confusion can be blamed on the complexity of the tools and materials that are traditionally used to teach CS1 and CS2. This textbook was written with a single overarching goal: to present the core concepts of computer science as simply as possible without being simplistic.
Winner of the 2014 Jolt Award for "Best Book" "Whether you are an experienced programmer or are starting your career, Python in Practice is full of valuable advice and example to help you improve your craft by thinking about problems from different perspectives, introducing tools, and detailing techniques to create more effective solutions." --Doug Hellmann, Senior Developer, DreamHost If you're an experienced Python programmer, Python in Practice will help you improve the quality, reliability, speed, maintainability, and usability of all your Python programs. Mark Summerfield focuses on four key themes: design patterns for coding elegance, faster processing through concurrency and compiled Python (Cython), high-level networking, and graphics. He identifies well-proven design patterns that are useful in Python, illuminates them with expert-quality code, and explains why some object-oriented design patterns are irrelevant to Python. He also explodes several counterproductive myths about Python programming--showing, for example, how Python can take full advantage of multicore hardware. All examples, including three complete case studies, have been tested with Python 3.3 (and, where possible, Python 3.2 and 3.1) and crafted to maintain compatibility with future Python 3.x versions. All code has been tested on Linux, and most code has also been tested on OS X and Windows. All code may be downloaded at www.qtrac.eu/pipbook.html. Coverage includes Leveraging Python's most effective creational, structural, and behavioral design patterns Supporting concurrency with Python's multiprocessing, threading, and concurrent.futures modules Avoiding concurrency problems using thread-safe queues and futures rather than fragile locks Simplifying networking with high-level modules, including xmlrpclib and RPyC Accelerating Python code with Cython, C-based Python modules, profiling, and other techniques Creating modern-looking GUI applications with Tkinter Leveraging today's powerful graphics hardware via the OpenGL API using pyglet and PyOpenGL
Whether you're building GUI prototypes or full-fledged cross-platform GUI applications with native look-and-feel, PyQt 4 is your fastest, easiest, most powerful solution. Qt expert Mark Summerfield has written the definitive best-practice guide to PyQt 4 development. With Rapid GUI Programming with Python and Qt you'll learn how to build efficient GUI applications that run on all major operating systems, including Windows, Mac OS X, Linux, and many versions of Unix, using the same source code for all of them. Summerfield systematically introduces every core GUI development technique: from dialogs and windows to data handling; from events to printing; and more. Through the book's realistic examples you'll discover a completely new PyQt 4-based programming approach, as well as coverage of many new topics, from PyQt 4's rich text engine to advanced model/view and graphics/view programming. Every key concept is illuminated with realistic, downloadable examples–all tested on Windows, Mac OS X, and Linux with Python 2.5, Qt 4.2, and PyQt 4.2, and on Windows and Linux with Qt 4.3 and PyQt 4.3.
Author: Bradley N. Miller
Publisher: Jones & Bartlett Publishers
Release Date: 2010-10-27
A user-friendly, object-oriented language, Python is quickly becoming the favorite introductory programming language among students and instructors. Many find Python to be a more lucid language than Java but with much of the functionality and therefore the ideal first language for those entering the world of Computer Science. Python Programming in Context is a clear, accessible introduction to the fundamental programming and problem solving concepts necessary for students at this level. The authors carefully build upon the many important computer science concepts and problem solving techniques throughout the text and offer relevant, real-world examples and exercises to reinforce key material. Programming skills throughout the text are linked to applied areas such as Image Processing, Cryptography, Astronomy, Music, the Internet, and Bioinformatics, giving students a well rounded look of its capabilities.
Get a comprehensive, in-depth introduction to the core Python language with this hands-on book. Based on author Mark Lutz’s popular training course, this updated fifth edition will help you quickly write efficient, high-quality code with Python. It’s an ideal way to begin, whether you’re new to programming or a professional developer versed in other languages. 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. Explore Python’s major built-in object types such as numbers, lists, and dictionaries Create and process objects with Python statements, and learn Python’s general syntax model Use functions to avoid code redundancy and package code for reuse Organize statements, functions, and other tools into larger components with modules Dive into classes: Python’s object-oriented programming tool for structuring code Write large programs with Python’s exception-handling model and development tools Learn advanced Python tools, including decorators, descriptors, metaclasses, and Unicode processing
“Hellmann’s writing has become an indispensable resource for me and many others as it fills a critical gap in Python Documentation with examples.” — Jesse Noller, Python Core Developer and PSF Board Member Master the Powerful Python Standard Library through Real Code Examples The Python Standard Library contains hundreds of modules for interacting with the operating system, interpreter, and Internet—all extensively tested and ready to jump-start your application development. The Python Standard Library by Example introduces virtually every important area of the Python 2.7 library through concise, stand-alone source code/output examples, designed for easy learning and reuse. Building on his popular Python Module of the Week blog series, author and Python expert Doug Hellmann focuses on “showing” not “telling.” He explains code behavior through downloadable examples that fully demonstrate each feature. You’ll find practical code for working with text, data types, algorithms, math, file systems, networking, the Internet, XML, email, cryptography, concurrency, runtime and language services, and much more. Each section fully covers one module, and links to valuable additional resources, making this book an ideal tutorial and reference. Coverage includes Manipulating text with string, textwrap, re, and difflib Implementing data structures: collections, array, queue, struct, copy, and more Reading, writing, and manipulating files and directories Regular expression pattern matching Exchanging data and providing for persistence Archiving and data compression Managing processes and threads Using application “building blocks”: parsing command-line options, prompting for passwords, scheduling events, and logging Testing, debugging, and compilation Controlling runtime configuration Using module and package utilities If you’re new to Python, this book will quickly give you access to a whole new world of functionality. If you’ve worked with Python before, you’ll discover new, powerful solutions and better ways to use the modules you’ve already tried.
Author: David Beazley
Publisher: Addison-Wesley Professional
Release Date: 2009-06-29
Python Essential Reference is the definitive reference guide to the Python programming language — the one authoritative handbook that reliably untangles and explains both the core Python language and the most essential parts of the Python library. Designed for the professional programmer, the book is concise, to the point, and highly accessible. It also includes detailed information on the Python library and many advanced subjects that is not available in either the official Python documentation or any other single reference source. Thoroughly updated to reflect the significant new programming language features and library modules that have been introduced in Python 2.6 and Python 3, the fourth edition of Python Essential Reference is the definitive guide for programmers who need to modernize existing Python code or who are planning an eventual migration to Python 3. Programmers starting a new Python project will find detailed coverage of contemporary Python programming idioms. This fourth edition of Python Essential Reference features numerous improvements, additions, and updates: Coverage of new language features, libraries, and modules Practical coverage of Python's more advanced features including generators, coroutines, closures, metaclasses, and decorators Expanded coverage of library modules related to concurrent programming including threads, subprocesses, and the new multiprocessing module Up-to-the-minute coverage of how to use Python 2.6’s forward compatibility mode to evaluate code for Python 3 compatibility Improved organization for even faster answers and better usability Updates to reflect modern Python programming style and idioms Updated and improved example code Deep coverage of low-level system and networking library modules — including options not covered in the standard documentation
The book serves as a first introduction to computer programming of scientific applications, using the high-level Python language. The exposition is example and problem-oriented, where the applications are taken from mathematics, numerical calculus, statistics, physics, biology and finance. The book teaches "Matlab-style" and procedural programming as well as object-oriented programming. High school mathematics is a required background and it is advantageous to study classical and numerical one-variable calculus in parallel with reading this book. Besides learning how to program computers, the reader will also learn how to solve mathematical problems, arising in various branches of science and engineering, with the aid of numerical methods and programming. By blending programming, mathematics and scientific applications, the book lays a solid foundation for practicing computational science. From the reviews: Langtangen ... does an excellent job of introducing programming as a set of skills in problem solving. He guides the reader into thinking properly about producing program logic and data structures for modeling real-world problems using objects and functions and embracing the object-oriented paradigm. ... Summing Up: Highly recommended. F. H. Wild III, Choice, Vol. 47 (8), April 2010 Those of us who have learned scientific programming in Python ‘on the streets’ could be a little jealous of students who have the opportunity to take a course out of Langtangen’s Primer.” John D. Cook, The Mathematical Association of America, September 2011 This book goes through Python in particular, and programming in general, via tasks that scientists will likely perform. It contains valuable information for students new to scientific computing and would be the perfect bridge between an introduction to programming and an advanced course on numerical methods or computational science. Alex Small, IEEE, CiSE Vol. 14 (2), March /April 2012 “This fourth edition is a wonderful, inclusive textbook that covers pretty much everything one needs to know to go from zero to fairly sophisticated scientific programming in Python...” Joan Horvath, Computing Reviews, March 2015
Mark Pilgrim's Dive Into Python 3 is a hands-on guide to Python 3 and its differences from Python 2. As in the original book, Dive Into Python, each chapter starts with a real, complete code sample, proceeds to pick it apart and explain the pieces, and then puts it all back together in a summary at the end. This book includes: Example programs completely rewritten to illustrate powerful new concepts now available in Python 3: sets, iterators, generators, closures, comprehensions, and much more A detailed case study of porting a major library from Python 2 to Python 3 A comprehensive appendix of all the syntactic and semantic changes in Python 3 This is the perfect resource for you if you need to port applications to Python 3, or if you like to jump into languages fast and get going right away.
Unleash the power of Python 3 objects About This Book Stop writing scripts and start architecting programs Learn the latest Python syntax and libraries A practical, hands-on tutorial that teaches you all about abstract design patterns and how to implement them in Python 3 Who This Book Is For If you're new to object-oriented programming techniques, or if you have basic Python skills and wish to learn in depth how and when to correctly apply object-oriented programming in Python to design software, this is the book for you. What You Will Learn Implement objects in Python by creating classes and defining methods Separate related objects into a taxonomy of classes and describe the properties and behaviors of those objects via the class interface Extend class functionality using inheritance Understand when to use object-oriented features, and more importantly when not to use them Discover what design patterns are and why they are different in Python Uncover the simplicity of unit testing and why it's so important in Python Grasp common concurrency techniques and pitfalls in Python 3 Exploit object-oriented programming in key Python technologies such as Kivy and Django. Object-oriented programming concurrently with asyncio In Detail Python 3 is more versatile and easier to use than ever. It runs on all major platforms in a huge array of use cases. Coding in Python minimizes development time and increases productivity in comparison to other languages. Clean, maintainable code is easy to both read and write using Python's clear, concise syntax. Object-oriented programming is a popular design paradigm in which data and behaviors are encapsulated in such a way that they can be manipulated together. Many modern programming languages utilize the powerful concepts behind object-oriented programming and Python is no exception. Starting with a detailed analysis of object-oriented analysis and design, you will use the Python programming language to clearly grasp key concepts from the object-oriented paradigm. This book fully explains classes, data encapsulation, inheritance, polymorphism, abstraction, and exceptions with an emphasis on when you can use each principle to develop well-designed software. You'll get an in-depth analysis of many common object-oriented design patterns that are more suitable to Python's unique style. This book will not just teach Python syntax, but will also build your confidence in how to program. You will also learn how to create maintainable applications by studying higher level design patterns. Following this, you'll learn the complexities of string and file manipulation, and how Python distinguishes between binary and textual data. Not one, but two very powerful automated testing systems will be introduced in the book. After you discover the joy of unit testing and just how easy it can be, you'll study higher level libraries such as database connectors and GUI toolkits and learn how they uniquely apply object-oriented principles. You'll learn how these principles will allow you to make greater use of key members of the Python eco-system such as Django and Kivy. This new edition includes all the topics that made Python 3 Object-oriented Programming an instant Packt classic. It's also packed with updated content to reflect recent changes in the core Python library and covers modern third-party packages that were not available on the Python 3 platform when the book was first published. Style and approach Throughout the book you will learn key object-oriented programming techniques demonstrated by comprehensive case studies in the context of a larger project.
The Only Official, Best-Practice Guide to Qt 4.3 Programming Using Trolltech's Qt you can build industrial-strength C++ applications that run natively on Windows, Linux/Unix, Mac OS X, and embedded Linux without source code changes. Now, two Trolltech insiders have written a start-to-finish guide to getting outstanding results with the latest version of Qt: Qt 4.3. Packed with realistic examples and in-depth advice, this is the book Trolltech uses to teach Qt to its own new hires. Extensively revised and expanded, it reveals today's best Qt programming patterns for everything from implementing model/view architecture to using Qt 4.3's improved graphics support. You'll find proven solutions for virtually every GUI development task, as well as sophisticated techniques for providing database access, integrating XML, using subclassing, composition, and more. Whether you're new to Qt or upgrading from an older version, this book can help you accomplish everything that Qt 4.3 makes possible. Completely updated throughout, with significant new coverage of databases, XML, and Qtopia embedded programming Covers all Qt 4.2/4.3 changes, including Windows Vista support, native CSS support for widget styling, and SVG file generation Contains separate 2D and 3D chapters, coverage of Qt 4.3's new graphics view classes, and an introduction to QPainter's OpenGL back-end Includes new chapters on look-and-feel customization and application scripting Illustrates Qt 4's model/view architecture, plugin support, layout management, event processing, container classes, and much more Presents advanced techniques covered in no other book—from creating plugins to interfacing with native APIs Includes a new appendix on Qt Jambi, the new Java version of Qt