文件名称:Python 2.4 Quick Reference Card (Letter) (2007).pdf
文件大小:608KB
文件格式:PDF
更新时间:2022-09-07 08:55:48
Python 2.4 Quick Reference Card
Python 2.4 Quick Reference Card ©2005-2007 — Laurent Pointal — License CC [by nc sa] CARD CONTENT Environment Variables........................1 Command-line Options.......................1 Files Extensions..................................1 Language Keywords............................1 Builtins................................................1 Types....................................................1 Functions..............................................1 Statements.........................................1 Blocks....................................................1 Assignment Shortcuts...........................1 Console & Interactive Input/Output....2 Objects, Names and Namespaces......2 Identifiers..............................................2 Objects and Names, Reference Counting...............................................2 Mutable/Immutable Objects..................2 Namespaces.........................................2 Constants, Enumerations......................2 Flow Control........................................2 Condition...............................................2 Loop......................................................2 Functions/methods exit.........................2 Exceptions............................................2 Iterable Protocol....................................2 Interpretation / Execution...................2 Functions Definitions & Usage............2 Parameters / Return value....................2 Lambda functions.................................2 Callable Objects....................................2 Calling Functions...................................3 Functions Control..................................3 Decorators............................................3 Types/Classes & Objects.....................3 Class Definition.....................................3 Object Creation.....................................3 Classes & Objects Relations..................3 Attributes Manipulation.........................3 Special Methods....................................3 Descriptors protocol..............................3 Copying Objects....................................3 Introspection.........................................3 Modules and Packages........................3 Source encodings..................................3 Special Attributes..................................3 Main Execution / Script Parameters....4 Operators............................................4 Priority..................................................4 Arithmetic Operators............................4 Comparison Operators..........................4 Operators as Functions.........................4 Booleans.............................................4 Numbers.............................................4 Operators..............................................4 Functions..............................................4 Bit Level Operations...........................5 Operators..............................................5 Strings................................................5 Escape sequences.................................5 Unicode strings.....................................5 Methods and Functions.........................5 Formating..............................................6 Constants..............................................6 Regular Expressions..............................6 Localization...........................................7 Multilingual Support..............................7 Containers..........................................8 Operations on Containers.....................8 Copying Containers...............................8 Overriding Containers Operations........8 Sequences..........................................8 Lists & Tuples........................................8 Operations on Sequences.....................8 Indexing................................................8 Operations on mutable sequences.......8 Overriding Sequences Operations........8 Mappings (dictionaries).......................8 Operations on Mappings.......................8 Overriding Mapping Operations............8 Other Mappings.....................................9 Sets.....................................................9 Operations on Sets................................9 Other Containers Structures, Algorithms..........................................9 Array.....................................................9 Queue...................................................9 Priority Queues.....................................9 Sorted List.............................................9 Iteration Tools.......................................9 Date & Time........................................9 Module time..........................................9 Module datetime.................................10 Module timeit......................................10 Other Modules.....................................10 Files..................................................10 File Objects.........................................10 Low-level Files.....................................10 Pipes...................................................10 In-memory Files..................................10 Files Informations................................11 Terminal Operations...........................11 Temporary Files..................................11 Path Manipulations..............................11 Directories...........................................11 Special Files........................................12 Copying, Moving, Removing...............12 Encoded Files......................................12 Serialization........................................12 Persistence..........................................12 Configuration Files..............................12 Exceptions........................................12 Standard Exception Classes................12 Warnings.............................................13 Exceptions Processing........................13 Encoding - Decoding.........................13 Threads & Synchronization...............13 Threading Functions...........................13 Threads...............................................13 Mutual Exclusion.................................13 Events.................................................13 Semaphores........................................13 Condition Variables.............................13 Synchronized Queues.........................13 Process.............................................13 Current Process...................................13 Signal Handling...................................14 Simple External Process Control.........14 Advanced External Process Control....15 XML Processing.................................15 SAX - Event-driven..............................15 DOM - In-memory Tree.......................16 Databases.........................................17 Generic access to DBM-style DBs.......17 Standard DB API for SQL databases....17 Bulk...................................................18