P
- package imports, Module Packages–Package initialization file roles, Module Packages, Packages and Search Path Settings, Package __init__.py Files–Package initialization file roles, Package initialization file roles, Package Import Example–from Versus import with Packages, from Versus import with Packages, Why Use Package Imports?–A Tale of Three Systems, Package Relative Imports–Example: Application to module self-test code (preview), Changes in Python 3.X, Relative Import Basics
-
- about, Module Packages–Package initialization file roles
- __all__ variable, Package initialization file roles
- from versus import statement, from Versus import with Packages
- __init__.py files, Package __init__.py Files–Package initialization file roles
- relative imports model, Module Packages, Package Relative Imports–Example: Application to module self-test code (preview)
- search path settings, Packages and Search Path Settings, Relative Import Basics
- usage considerations, Why Use Package Imports?–A Tale of Three Systems
- usage example, Package Import Example–from Versus import with Packages
- version considerations, Changes in Python 3.X
- packages, Module Packages, Module Packages, Module Packages, Package Import Basics–A Tale of Three Systems, Packages and Search Path Settings, Package initialization file roles, A Tale of Three Systems, Package Relative Imports–Example: Application to module self-test code (preview), Relative Import Basics, Module Lookup Rules Summary, Python 3.3 Namespace Packages–Files Still Have Precedence over Directories, Test Your Knowledge: Quiz
-
- about, Module Packages, A Tale of Three Systems
- __all__ variable, Package initialization file roles
- namespace package model, Module Packages, Module Lookup Rules Summary, Python 3.3 Namespace Packages–Files Still Have Precedence over Directories
- package imports, Package Import Basics–A Tale of Three Systems
- quiz questions and answers, Test Your Knowledge: Quiz
- relative imports model, Module Packages, Package Relative Imports–Example: Application to module self-test code (preview)
- search path settings, Packages and Search Path Settings, Relative Import Basics
- parameters, def Statements (see arguments)
- parentheses ( ), Comprehensions, Parentheses group subexpressions, Tuple syntax peculiarities: Commas and parentheses, Parentheses are optional, Statement rule special cases, Classes Are Customized by Inheritance
-
- comprehensions and, Comprehensions
- expression operators and, Parentheses group subexpressions
- statements and, Parentheses are optional, Statement rule special cases
- superclasses and, Classes Are Customized by Inheritance
- tuples and, Tuple syntax peculiarities: Commas and parentheses
- Parrot project, Future Possibilities?
- parsing text in strings, String Method Examples: Parsing Text
- pass statement, Python’s Statements, break, continue, pass, and the Loop else–pass
- passing-arguments-by-pointer, Argument-Passing Basics
- passing-arguments-by-value, Argument-Passing Basics
- PATH environment variable, The System Path, New Windows Options in 3.3: PATH, Launcher, Command-Line Usage Variations, The Unix env Lookup Trick, Python Environment Variables, Python Environment Variables
-
- about, Python Environment Variables, Python Environment Variables
- env program and, The Unix env Lookup Trick
- new Windows options, New Windows Options in 3.3: PATH, Launcher
- setting, The System Path, Command-Line Usage Variations
- paths, Usage Notes: import and reload, Cycles, paths, and stack limits, The Module Search Path–Optimized byte code files, Package Import Basics, Packages and Search Path Settings, Relative Import Basics, Module Lookup Rules Summary, Changing the Module Search Path–Changing the Module Search Path, Path files, Running modules on the search path
-
- module search paths, Usage Notes: import and reload, The Module Search Path–Optimized byte code files, Module Lookup Rules Summary, Changing the Module Search Path–Changing the Module Search Path, Path files, Running modules on the search path
- package imports, Package Import Basics
- package search paths, Packages and Search Path Settings, Relative Import Basics
- recording for recursive calls, Cycles, paths, and stack limits
- pattern matching in strings, Pattern Matching, Pattern Matching, Other Common String Methods in Action, The re Pattern-Matching Module
-
- about, Pattern Matching
- re module and, Pattern Matching, Other Common String Methods in Action, The re Pattern-Matching Module
- pdb command-line debugger, Which Option Should I Use?, Development Tools for Larger Projects
- PEP (Python Enhancement Proposal), How Is Python Developed and Supported?
- percent sign (%), Starting an Interactive Session, What Not to Type: Prompts and Comments, Running Files with Command Lines, Formatting Expression Basics, Comparison to the % Formatting Expression–Comparison to the % Formatting Expression, Method Calls
-
- formatting expression operator, Formatting Expression Basics, Comparison to the % Formatting Expression–Comparison to the % Formatting Expression, Method Calls
- system shell prompt, Starting an Interactive Session, What Not to Type: Prompts and Comments, Running Files with Command Lines
- performance considerations, Performance implications, PyPy: Python for speed, On the other hand: performance, conciseness, expressiveness, On the other hand: performance, conciseness, expressiveness, Scope of search order change, What about slots speed?
-
- (see also benchmarking)
- list comprehensions, On the other hand: performance, conciseness, expressiveness
- MRO and, Scope of search order change
- program execution, Performance implications
- Python alternatives, PyPy: Python for speed
- slots, What about slots speed?
- Perl programming language, Test Your Knowledge: Answers
- permutations, Permutations: All possible combinations–Permutations: All possible combinations
- persistence, Nesting Revisited (see object persistence)
- Peters, Tim, Full Credit
- pexpect system, Other File Tools
- pickle module, Database Programming, Nesting Revisited, Storing Native Python Objects: pickle, Other File Tools, Pickles and Shelves, Stream Processors Revisited, The pickle Object Serialization Module–The pickle Object Serialization Module
-
- about, Pickles and Shelves
- object persistence and, Database Programming, Nesting Revisited
- object serialization and, The pickle Object Serialization Module–The pickle Object Serialization Module
- persistence and, Stream Processors Revisited
- storing objects, Storing Native Python Objects: pickle, Other File Tools
- plus (+) operator, Numbers, Sequence Operations, Basic Operations, Basic List Operations, Example: Catching Built-in Exceptions, Example: Catching Built-in Exceptions
-
- adding numbers, Numbers
- concatenating lists, Basic List Operations, Example: Catching Built-in Exceptions
- concatenating strings, Sequence Operations, Basic Operations, Example: Catching Built-in Exceptions
- PMW extension package, GUIs
- polymorphism, Sequence Operations, How to Break Your Code’s Flexibility, Preview: Operator overloading and polymorphism, Polymorphism in Python, Polymorphism Revisited, Polymorphism and classes–Polymorphism and classes, Polymorphism in Action, Python and OOP, Polymorphism Means Interfaces, Not Call Signatures, More on sys.exc_info
-
- about, Sequence Operations, How to Break Your Code’s Flexibility, Python and OOP
- classes and, Polymorphism and classes–Polymorphism and classes, Polymorphism in Action
- in functions, Polymorphism in Python, Polymorphism Revisited
- OOP considerations, Polymorphism Means Interfaces, Not Call Signatures
- operator overloading and, Preview: Operator overloading and polymorphism
- testing exception types, More on sys.exc_info
- portability, It’s Portable
- positional arguments, Argument Matching Basics, Headers: Collecting arguments, A Basic Range-Testing Decorator for Positional Arguments–Other Applications: Type Testing (If You Insist!)
- pow built-in function, Other Built-in Numeric Tools
- pprint module, Example: Mapping Attributes to Inheritance Sources, Example: Mapping Attributes to Inheritance Sources, Example: Mapping Attributes to Inheritance Sources
-
- pformat function, Example: Mapping Attributes to Inheritance Sources
- pprint function, Example: Mapping Attributes to Inheritance Sources
- usage considerations, Example: Mapping Attributes to Inheritance Sources
- precedence rules, Mixed operators follow operator precedence
- print built-in function, Running Code Interactively, The Python 3.X print Function–The 3.X print function in action, Emulating the Python 3.X print Function–Using Keyword-Only Arguments
- print operations, Running Code Interactively, Running Code Interactively, Other File Tools, Expression Statements, Print Operations, Print Operations, Print Operations, The Python 3.X print Function–The 2.X print statement in action, The Python 3.X print Function–The 3.X print function in action, Print Stream Redirection–Automatic stream redirection, Version-Neutral Printing–Neutralizing display differences with code, Neutralizing display differences with code, Test Your Knowledge: Quiz, Emulating the Python 3.X print Function–Using Keyword-Only Arguments, Emulating the Python 3.X print Function–Using Keyword-Only Arguments, Using Code Two Ways, Providing Print Displays–Providing Print Displays, Default Printing and State–Default Printing and State, Custom Print Displays, Encore: Print Your Own Completion Certificate!–Encore: Print Your Own Completion Certificate!
-
- (see also print statement)
- about, Print Operations
- built-in exception classes and, Default Printing and State–Default Printing and State
- completion certificate, Encore: Print Your Own Completion Certificate!–Encore: Print Your Own Completion Certificate!
- custom displays, Custom Print Displays
- display formats, Providing Print Displays–Providing Print Displays
- expression statements and, Expression Statements
- file object methods and, Print Operations
- print built-in function, Running Code Interactively, The Python 3.X print Function–The 3.X print function in action, Emulating the Python 3.X print Function–Using Keyword-Only Arguments
- print stream redirection, Print Stream Redirection–Automatic stream redirection
- quiz questions and answers, Test Your Knowledge: Quiz
- standard output stream, Other File Tools, Print Operations, Neutralizing display differences with code
- version considerations, The Python 3.X print Function–The 2.X print statement in action, Emulating the Python 3.X print Function–Using Keyword-Only Arguments, Using Code Two Ways
- version-neutral, Version-Neutral Printing–Neutralizing display differences with code
- print statement, Running Code Interactively, Usage Notes: The Interactive Prompt, Usage Notes: Command Lines and Files, Which Option Should I Use?, Numeric Display Formats, The Python 2.X print Statement–The 2.X print statement in action
-
- about, Running Code Interactively, The Python 2.X print Statement–The 2.X print statement in action
- common usage mistakes, Usage Notes: The Interactive Prompt, Usage Notes: Command Lines and Files
- debugging code and, Which Option Should I Use?
- numeric display formats and, Numeric Display Formats
- private attributes, Implementing Private Attributes–Using __dict__ and __slots__ (and other virtual names)
- procedures, Expression Statements (see functions)
- profile module, Iteration and Optimization, Other Suggestions, Development Tools for Larger Projects
- program architecture, Import and Reload Basics, The Python Conceptual Hierarchy, The Python Conceptual Hierarchy Revisited, Python Program Architecture–Standard Library Modules
-
- about, Import and Reload Basics
- conceptual hierarchy, The Python Conceptual Hierarchy, The Python Conceptual Hierarchy Revisited
- modules and, Python Program Architecture–Standard Library Modules
- program execution, How Python Runs Programs, Introducing the Python Interpreter–Introducing the Python Interpreter, The Programmer’s View–The Programmer’s View, Python’s View, Byte code compilation–Byte code compilation, Byte code compilation, The Python Virtual Machine (PVM), Performance implications, Development implications, Execution Model Variations–Future Possibilities?, Execution Optimization Tools–Psyco: The original just-in-time compiler, Frozen Binaries, Future Possibilities?, Test Your Knowledge: Quiz, The Interactive Prompt–Entering multiline statements, System Command Lines and Files–Usage Notes: Command Lines and Files, Unix-Style Executable Scripts: #!–The Python 3.3 Windows Launcher: #! Comes to Windows, Clicking File Icons–Other Icon-Click Limitations, Module Imports and Reloads–Usage Notes: import and reload, Using exec to Run Module Files–Using exec to Run Module Files, The IDLE User Interface–Usage Notes: IDLE, Other IDEs–Other IDEs, Other Launch Options–Future Possibilities?, Embedding Calls, Frozen Binary Executables, Text Editor Launch Options, Future Possibilities?, Which Option Should I Use?, Which Option Should I Use?–Which Option Should I Use?, Test Your Knowledge: Quiz–Test Your Knowledge: Answers
-
- about, How Python Runs Programs
- alternative IDEs, Other IDEs–Other IDEs
- alternative launch options, Other Launch Options–Future Possibilities?
- byte code compilation and, Byte code compilation–Byte code compilation
- clicking file icons, Clicking File Icons–Other Icon-Click Limitations
- debugging code, Which Option Should I Use?–Which Option Should I Use?
- development considerations, Development implications
- embedding calls, Embedding Calls
- exec built-in function and, Using exec to Run Module Files–Using exec to Run Module Files
- frozen binaries, Frozen Binaries, Frozen Binary Executables
- future possibilities, Future Possibilities?, Future Possibilities?
- IDLE user interface, The IDLE User Interface–Usage Notes: IDLE
- interactive prompt, Byte code compilation, The Interactive Prompt–Entering multiline statements
- interpreters and, Introducing the Python Interpreter–Introducing the Python Interpreter, Python’s View
- model variations in, Execution Model Variations–Future Possibilities?
- module imports and reloads, Module Imports and Reloads–Usage Notes: import and reload
- optimization tools, Execution Optimization Tools–Psyco: The original just-in-time compiler
- performance considerations, Performance implications
- programmer’s perspective, The Programmer’s View–The Programmer’s View
- PVM and, The Python Virtual Machine (PVM)
- quiz questions and answers, Test Your Knowledge: Quiz, Test Your Knowledge: Quiz–Test Your Knowledge: Answers
- selecting from options, Which Option Should I Use?
- system command lines and files, System Command Lines and Files–Usage Notes: Command Lines and Files
- text editor launch options, Text Editor Launch Options
- Unix-style scripts, Unix-Style Executable Scripts: #!–The Python 3.3 Windows Launcher: #! Comes to Windows
- program units, Python’s Core Data Types, Python’s Core Data Types
-
- (see also classes; functions; modules)
- Programming Python (Lutz), Just How New Is New-Style?
- programs, System Command Lines and Files, System Command Lines and Files, The Python Conceptual Hierarchy, Example: Modules Are Objects–Example: Modules Are Objects
-
- about, System Command Lines and Files
- metaprograms, Example: Modules Are Objects–Example: Modules Are Objects
- modules and, System Command Lines and Files, The Python Conceptual Hierarchy
- prompts, What Not to Type: Prompts and Comments (see interactive prompt; system prompt)
- properties, Class Objects Provide Default Behavior, Example, Properties: Attribute Accessors–Property basics, Property basics, Properties–Setter and deleter decorators, Coding Properties with Decorators–Setter and deleter decorators, How Properties and Descriptors Relate–Descriptors and slots and more, Using Properties to Validate–Testing code
-
- about, Properties: Attribute Accessors–Property basics
- attribute, Properties–Setter and deleter decorators
- class statement, Class Objects Provide Default Behavior, Example, Property basics
- coding with decorators, Coding Properties with Decorators–Setter and deleter decorators
- descriptors and, How Properties and Descriptors Relate–Descriptors and slots and more
- validating with, Using Properties to Validate–Testing code
- property built-in function, Property basics, Function Decorator Basics, Inserting Code to Run on Attribute Access, How Properties and Descriptors Relate
- prototyping systems, Rapid Prototyping
- proxy classes (wrappers), OOP and Delegation: “Wrapper” Proxy Objects–OOP and Delegation: “Wrapper” Proxy Objects, Why the lookup change?, Managing Calls and Instances
-
- about, OOP and Delegation: “Wrapper” Proxy Objects–OOP and Delegation: “Wrapper” Proxy Objects
- decorators installing, Managing Calls and Instances
- delegation and, Why the lookup change?
- pseudoprivate class attributes, Name Considerations in Tool Classes, Pseudoprivate Class Attributes–Why Use Pseudoprivate Attributes?, Development Tools for Larger Projects, Using __X pseudoprivate names
-
- about, Name Considerations in Tool Classes, Pseudoprivate Class Attributes–Why Use Pseudoprivate Attributes?
- larger projects and, Development Tools for Larger Projects
- public attributes and, Using __X pseudoprivate names
- PSF (Python Software Foundation), How Is Python Developed and Supported?
- pstats module, Development Tools for Larger Projects
- Psyco system, PyPy: Python for speed, Psyco: The original just-in-time compiler
- .pth file extension, Packages and Search Path Settings
- public attributes, Generalizing for Public Declarations, Too–Decorator tradeoffs
- PVM (Python Virtual Machine), The Python Virtual Machine (PVM)
- .py file extension, The Programmer’s View, A First Script, Usage Notes: IDLE, 2. Compile It (Maybe), Module Filenames
-
- about, The Programmer’s View, 2. Compile It (Maybe), Module Filenames
- common usage mistakes, Usage Notes: IDLE
- imported files and, A First Script
- py2app tool, Frozen Binaries
- py2exe tool, Frozen Binaries
- .pyc file extension, Byte code compilation, 2. Compile It (Maybe), Byte Code Files: __pycache__ in Python 3.2+
- __pycache__ subdirectory, Byte code compilation, Clicking Icons on Windows, 2. Compile It (Maybe), Byte Code Files: __pycache__ in Python 3.2+–Byte Code File Models in Action
- PyChecker tool, Hiding built-ins by assignment: Shadowing, Development Tools for Larger Projects
- PyDev IDE, Other IDEs
- PyDoc system, Getting Help, Python Documentation Sources, PyDoc: The help Function–PyDoc: The help Function, PyDoc: HTML Reports–Python 3.2 and earlier: GUI client, PyDoc: HTML Reports–Python 3.2 and earlier: GUI client, Python 3.2 and later: PyDoc’s all-browser mode, Documentation Strings Revisited, Development Tools for Larger Projects
-
- about, Getting Help, Python Documentation Sources
- changing colors in, Python 3.2 and later: PyDoc’s all-browser mode
- help function, PyDoc: The help Function–PyDoc: The help Function, Documentation Strings Revisited, Development Tools for Larger Projects
- HTML reports, PyDoc: HTML Reports–Python 3.2 and earlier: GUI client
- version considerations, PyDoc: HTML Reports–Python 3.2 and earlier: GUI client
- pydoc.py script, Python 3.2 and earlier: GUI client
- pygame toolkit, Frozen Binaries
- PyInstaller tool, Frozen Binaries, Development Tools for Larger Projects
- PyLint system, Development Tools for Larger Projects
- PyMongo interface, Nesting Revisited
- .pyo file extension, Optimized byte code files
- PyPy system, OK, but What’s the Downside?, Python Implementation Alternatives, PyPy: Python for speed, Interactive usage and API calls–Command-line usage, A win for map and a rare loss for PyPy
-
- about, OK, but What’s the Downside?, Python Implementation Alternatives
- benchmarking, A win for map and a rare loss for PyPy
- performance considerations, PyPy: Python for speed
- timeit module and, Interactive usage and API calls–Command-line usage
- Pyrolog interpreter, PyPy: Python for speed
- PySerial extension, Other File Tools
- PySolFC program, And More: Gaming, Images, Data Mining, Robots, Excel...
- pystone.py program, Other Benchmarking Topics: pystones
- Python Enhancement Proposal (PEP), How Is Python Developed and Supported?
- Python interpreter, Introducing the Python Interpreter, Introducing the Python Interpreter, Python’s View, Byte code compilation–Byte code compilation, The Python Virtual Machine (PVM), Performance implications, Development implications, PyPy: Python for speed, The Unix env Lookup Trick, Installing the Python Interpreter–Installation Steps, Configuring Python–Python 3.3 Windows Launcher Command Lines, For More Help
-
- about, Introducing the Python Interpreter, Python’s View
- additional information, For More Help
- alternatives to, PyPy: Python for speed
- byte code and, Byte code compilation–Byte code compilation
- configuring, Configuring Python–Python 3.3 Windows Launcher Command Lines
- development considerations, Development implications
- installing, Introducing the Python Interpreter, Installing the Python Interpreter–Installation Steps
- locating with env program, The Unix env Lookup Trick
- performance considerations, Performance implications
- PVM and, The Python Virtual Machine (PVM)
- Python programming language, The Python 2.X and 3.X Lines, Why Do People Use Python?–Developer Productivity, Is Python a “Scripting Language”?, OK, but What’s the Downside?, OK, but What’s the Downside?, Who Uses Python Today?–Who Uses Python Today?, What Can I Do with Python?–And More: Gaming, Images, Data Mining, Robots, Excel..., What Can I Do with Python?–And More: Gaming, Images, Data Mining, Robots, Excel..., How Is Python Developed and Supported?, Open Source Tradeoffs, What Are Python’s Technical Strengths?–It’s Named After Monty Python, It’s Portable, It’s Powerful, How Does Python Stack Up to Language X?–How Does Python Stack Up to Language X?, Test Your Knowledge: Quiz–Test Your Knowledge: Answers, Test Your Knowledge: Answers, Python Implementation Alternatives–PyPy: Python for speed, Stackless: Python for concurrency, New Windows Options in 3.3: PATH, Launcher, The Python Conceptual Hierarchy, Future Directions–Future Directions, The Python Toolset, The Python Paradox–Where to Go From Here, For More Help
-
- additional information, For More Help
- advantages of, Why Do People Use Python?–Developer Productivity
- common applications of, What Can I Do with Python?–And More: Gaming, Images, Data Mining, Robots, Excel...
- compared to other languages, How Does Python Stack Up to Language X?–How Does Python Stack Up to Language X?
- compared to Perl, Test Your Knowledge: Answers
- development community, How Is Python Developed and Supported?
- execution speed, OK, but What’s the Downside?
- future directions, Future Directions–Future Directions
- implementation alternatives, Python Implementation Alternatives–PyPy: Python for speed
- new Windows options, New Windows Options in 3.3: PATH, Launcher
- paradox of, The Python Paradox–Where to Go From Here
- pillars of programming, The Python Conceptual Hierarchy
- portability, It’s Portable
- quiz questions and answers, Test Your Knowledge: Quiz–Test Your Knowledge: Answers
- scripting and, Is Python a “Scripting Language”?
- technical strengths, What Are Python’s Technical Strengths?–It’s Named After Monty Python
- tools supporting, What Can I Do with Python?–And More: Gaming, Images, Data Mining, Robots, Excel..., It’s Powerful, The Python Toolset
- tradeoffs using, OK, but What’s the Downside?, Open Source Tradeoffs
- user base, Who Uses Python Today?–Who Uses Python Today?, Stackless: Python for concurrency
- version considerations, The Python 2.X and 3.X Lines (see version considerations for Python)
- Python Software Foundation (PSF), How Is Python Developed and Supported?
- Python Virtual Machine (PVM), The Python Virtual Machine (PVM)
- PYTHONIOENCODING environment variable, Stream content: PYTHONIOENCODING
- PythonLauncher, Icon-Click Basics
- PYTHONPATH environment variable, Usage Notes: import and reload, Python 3.2 and earlier: GUI client, The Module Search Path, Packages and Search Path Settings, Changing the Module Search Path, Python Environment Variables, Python Environment Variables, Windows environment variable GUI
-
- about, Python Environment Variables, Python Environment Variables
- module search paths, Usage Notes: import and reload, The Module Search Path, Changing the Module Search Path
- package search paths, Packages and Search Path Settings
- PyDoc HTML reports, Python 3.2 and earlier: GUI client
- Windows platform and, Windows environment variable GUI
- PYTHONSTARTUP environment variable, Python Environment Variables, Python Environment Variables
- PythonWin IDE, Other IDEs
- PyUnit tool, Development Tools for Larger Projects
- .pyw file extension, New Windows Options in 3.3: PATH, Launcher
- PY_PYTHON environment variable, The Python 3.3 Windows Launcher: #! Comes to Windows, Python Environment Variables, Python Environment Variables
- PY_PYTHON2 environment variable, Python Environment Variables, Python Environment Variables
- PY_PYTHON3 environment variable, Python Environment Variables, Python Environment Variables