Programming in Python 3 a complete introduction to the Python language
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 co...
Autor principal: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Upper Saddle River, NJ :
Addison-Wesley
c2009.
|
Edición: | 1st edition |
Colección: | Developer's library
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009627718606719 |
Tabla de Contenidos:
- Cover
- Contents
- Introduction
- Chapter 1. Rapid Introduction to Procedural Programming
- Creating and Running Python Programs
- Python's "Beautiful Heart"
- Piece #1: Data Types
- Piece #2: Object References
- Piece #3: Collection Data Types
- Piece #4: Logical Operations
- Piece #5: Control Flow Statements
- Piece #6: Arithmetic Operators
- Piece #7: Input/Output
- Piece #8: Creating and Calling Functions
- Examples
- bigdigits.py
- generate_grid.py
- Summary
- Exercises
- Chapter 2. Data Types
- Identifiers and Keywords
- Integral Types
- Integers
- Booleans
- Floating-Point Types
- Floating-Point Numbers
- Complex Numbers
- Decimal Numbers
- Strings
- Comparing Strings
- Slicing and Striding Strings
- String Operators and Methods
- String Formatting with the str.format() Method
- Character Encodings
- Examples
- quadratic.py
- csv2html.py
- Summary
- Exercises
- Chapter 3. Collection Data Types
- Sequence Types
- Tuples
- Named Tuples
- Lists
- Set Types
- Sets
- Frozen Sets
- Mapping Types
- Dictionaries
- Default Dictionaries
- Iterating and Copying Collections
- Iterators and Iterable Operations and Functions
- Copying Collections
- Examples
- generate_usernames.py
- statistics.py
- Summary
- Exercises
- Chapter 4. Control Structures and Functions
- Control Structures
- Conditional Branching
- Looping
- Exception Handling
- Catching and Raising Exceptions
- Custom Exceptions
- Custom Functions
- Names and Docstrings
- Argument and Parameter Unpacking
- Accessing Variables in the Global Scope
- Lambda Functions
- Assertions
- Example: make_html_skeleton.py
- Summary
- Exercise
- Chapter 5. Modules
- Modules and Packages
- Packages
- Custom Modules
- Overview of Python's Standard Library
- String Handling
- Command-Line Programming
- Mathematics and Numbers.
- Times and Dates
- Algorithms and Collection Data Types
- File Formats, Encodings, and Data Persistence
- File, Directory, and Process Handling
- Networking and Internet Programming
- XML
- Other Modules
- Summary
- Exercise
- Chapter 6. Object-Oriented Programming
- The Object-Oriented Approach
- Object-Oriented Concepts and Terminology
- Custom Classes
- Attributes and Methods
- Inheritance and Polymorphism
- Using Properties to Control Attribute Access
- Creating Complete and Fully Integrated Data Types
- Custom Collection Classes
- Creating Classes That Aggregate Collections
- Creating Collection Classes Using Aggregation
- Creating Collection Classes Using Inheritance
- Summary
- Exercises
- Chapter 7. File Handling
- Writing and Reading Binary Data
- Pickles with Optional Compression
- Raw Binary Data with Optional Compression
- Writing and Parsing Text Files
- Writing Text
- Parsing Text
- Parsing Text Using Regular Expressions
- Writing and Parsing XML Files
- Element Trees
- DOM (Document Object Model)
- Manually Writing XML
- Parsing XML with SAX (Simple API for XML)
- Random Access Binary Files
- A Generic BinaryRecordFile Class
- Example: The BikeStock Module's Classes
- Summary
- Exercises
- Chapter 8. Advanced Programming Techniques
- Further Procedural Programming
- Branching Using Dictionaries
- Generator Expressions and Functions
- Dynamic Code Execution and Dynamic Imports
- Local and Recursive Functions
- Function and Method Decorators
- Function Annotations
- Further Object-Oriented Programming
- Controlling Attribute Access
- Functors
- Context Managers
- Descriptors
- Class Decorators
- Abstract Base Classes
- Multiple Inheritance
- Metaclasses
- Functional-Style Programming
- Partial Function Application
- Example: Valid.py
- Summary
- Exercises.
- Chapter 9. Processes and Threading
- Delegating Work to Processes
- Delegating Work to Threads
- Example: A Threaded Find Word Program
- Example: A Threaded Find Duplicate Files Program
- Summary
- Exercises
- Chapter 10. Networking
- Creating a TCP Client
- Creating a TCP Server
- Summary
- Exercises
- Chapter 11. Database Programming
- DBM Databases
- SQL Databases
- Summary
- Exercise
- Chapter 12. Regular Expressions
- Python's Regular Expression Language
- Characters and Character Classes
- Quantifiers
- Grouping and Capturing
- Assertions and Flags
- The Regular Expression Module
- Summary
- Exercises
- Chapter 13. Introduction to GUI Programming
- Dialog-Style Programs
- Main-Window-Style Programs
- Creating a Main Window
- Creating a Custom Dialog
- Summary
- Exercises
- Epilogue
- Index.