- Python核心编程(第二版)
- cover
- 异常处理
- 检测与处理异常
- 上下文管理与with 语句
- 触发异常
- 断言
- 异常与sys模块
- traceback
- 处理时间
- time.time()
- time.ctime()
- time.clock()
- struct_time
- 解析与格式化时间
- 使用Time Zone
- 产生随机数
- random.randint()
- random.randrange()
- random.random()和random.uniform()
- random.choice()和random.sample()
- random.shuffle()
- import
- socket编程
- 字符串模板
- 命令行参数解析optparse
- cmd模块
- 对XML进行操作
- 参数形式传递函数
- 多线程编程
- base64编码
- base64编码
- base64解码
- URL_Safe变体
- 重载操作符
- 格式化输出
- 序列化
- 使用chardet检测字符编码
- logging
- 全局变量与global语句
- collection小技巧
- 生成器
- 可变长参数
- 闭包编程
- 实例属性与类属性
- 元类编程
- filter()、map()、reduce()与lambda
- 偏函数应用
- Python高级编程
- 语法最佳实践——低于类级
- 列表推导
- 迭代器和生成器
- 装饰器
- with和contextlib
- 语法最佳实践——类级
- 子类化内建函数
- 访问超类中的方法
- 描述符和属性
- 槽
- 元编程
- 优化:解决方案
- 有序list中进行二分查找
- set保存无重复key的list
- deque
- defaultdict
- namedtuple
- 设计模式
- 单例模式
- 外观模式
- 观察者
- 访问者
- 模板
- 语法最佳实践——低于类级
- Programming in Python 3
- Data Types
- IDENTIFIERS AND KEYWORDS
- dir()
__builtins__
- single underscore
- gettext()
- INTEGRAL TYPES
- Integers
- Numeric Operators and Functions
- Integer Conversion Functions
- Integer Bitwise Operators
- int.bit_length()
- Integers
- FLOATING-POINT TYPES
- Floating-Point Numbers
- The Math Module’s Functions and Constants
- Complex Numbers
- conjugate()
- Decimal Numbers
- STRINGS
- Python’s String Escapes
- ord()
- chr()
- Comparing Strings
- unicodedata.normalize()
- Slicing and Striding Strings
- String Operators and Methods
- String Methods
- str.join()
-
- operator
- str.index()
- str.count(), str.endswith(), str.find(), str.rfind(), str.index(), str.rindex(), and str.startswith()
- str.partition(), str.rpartition()
- str.isdigit()
- str.translate()
- String Formatting with the str.format() Method
- str.format()
- Field Names
- Conversions
- Format Specifications
- locale
- Character Encodings
- str.encode()
- str.encode()
- IDENTIFIERS AND KEYWORDS
- Collection Data Types
- SEQUENCE TYPES
- Tuples
- Tuple index positions
- t.count(x)
- operators + (concatenation), * (replication), and [] (slice), and with in and not in
- the standard comparison operators (<, <=, ==, !=, >=, >)
- Named Tuples
- Lists
- List index positions
- List Methods
- sequence unpacking operator, an asterisk or star (*)
- starred expressions
- starred arguments
- List Comprehensions
- Tuples
- SET TYPES
- Sets
- The standard set operators
- Set Methods and Operators
- Set Comprehensions
- Frozen Sets
- frozenset()
- Sets
- MAPPING TYPES
- Dictionaries
- Dictionary Methods
- dict.items(), dict.keys(), and dict.values() methods all return dictionary views
- membership operator, in
- intersection operator
- dict.get()
- Dictionary Comprehensions
- Default Dictionaries
- Ordered Dictionaries
- popitem()
- popitem(last=False)
- Dictionaries
- ITERATING AND COPYING COLLECTIONS
- Iterators and Iterable Operations and Functions
__iter__()
,__getitem__()
,__next__()
,StopIteration- Common Iterable Operators and Functions
- all(), any(), len(), min(), max(), and sum()
- range()
- zip()
- sorted(),reversed()
- Copying Collections
- operator (=)
- dict.copy() and set.copy()
- copy.copy()
- built-in collection types
- shallow-copy
- deep-copy
- Iterators and Iterable Operations and Functions
- SEQUENCE TYPES
- Control Structures and Functions
- CONTROL STRUCTURES
- Conditional Branching
- Looping
- while Loops
- for Loops
- EXCEPTION HANDLING
- Catching and Raising Exceptions
- Some of Python’s exception hierarchy
- Try ... except ... finally control flows
- Raising Exceptions
- Custom Exceptions
- Catching and Raising Exceptions
- CUSTOM FUNCTIONS
- Argument and Parameter Unpacking
- Accessing Variables in the Global Scope
- global
- Lambda Functions
- Assertions
- CONTROL STRUCTURES
- Object-Oriented Programming
- THE OBJECT-ORIENTED APPROACH
- Object-Oriented Concepts and Terminology
- virtual
- Object-Oriented Concepts and Terminology
- CUSTOM CLASSES
- Attributes and Methods
- Comparison Special Methods
- Inheritance and Polymorphism
__init__()
- super()
- Using Properties to Control Attribute Access
- property()
- @property
- getter, setter, and docstring
- getter, setter, and deleter
- Creating Complete Fully Integrated Data Types
- Fundamental Special Methods
- Numeric and Bitwise Special Methods
__del__(self)
- Attributes and Methods
- CUSTOM COLLECTION CLASSES
- Collection Special Methods
- FURTHER OBJECT-ORIENTED PROGRAMMING
__slots__
,__dict__
- Controlling Attribute Access
__getattr__()
,__setattr__()
, and- Attribute Access Special Methods
- named tuples
- read-only properties
__getattr__()
,__getattribute__()
__class__
- Functors
__call__()
- closure
- people.sort(key=SortKey("surname")),people.sort(key=SortKey("surname", "forename"))
- operator.attrgetter(),people.sort(key=operator.attrgetter("surname", "forename"))
- Context Managers
__enter__()
and__exit__()
- with
- Descriptors
__get__()
,__set__()
, and__delete__()
- Class Decorators
- nonlocal
- Abstract Base
- The Numbers Module’s Abstract Base Classes
- The Collections Module’s Main Abstract Base Classes
__init__()
- property is abstract
- Multiple Inheritance
- Metaclasses
__new__()
__init__()
- THE OBJECT-ORIENTED APPROACH
- Procedural Programming Techniques
- FURTHER PROCEDURAL PROGRAMMING
- Branching Using Dictionaries
- Generator Expressions and Functions
- Dynamic Code Execution and Dynamic Imports
- Dynamic Code Execution
- eval()
- exec()
- globals()
- Dynamically Importing Modules
- Dynamic Programming and Introspection Functions
- Function and Method Decorators
- @functools.wraps
- Function Annotations
__annotations__
- type-checking decorator
- Dynamic Code Execution
- FURTHER PROCEDURAL PROGRAMMING
- Functional-Style Programming
- functools.reduce()
- operator.attrgetter()
- itertools.chain()
- Partial Function Application
- Coroutines
- yield
- Performing Independent Actions on Data
- Composing Pipelines
- Coroutines
- Data Types
-
Notifications
You must be signed in to change notification settings - Fork 0
zhangjunhd/python-examples
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published