Read Programming Python Online

Authors: Mark Lutz

Tags: #COMPUTERS / Programming Languages / Python

Programming Python (212 page)

BOOK: Programming Python
5.29Mb size Format: txt, pdf, ePub
ads
N
name conventions,
File name conventions
,
Installing CGI scripts
CGI scripts,
Installing CGI scripts
files,
File name conventions
__name__ variable,
Using Programs in Two Ways
named pipes,
Interprocess Communication
,
Anonymous Pipes
,
Named Pipes (Fifos)
,
Named pipe basics
,
Named pipe basics
,
Named pipe use cases
basic functionality,
Named pipe basics
,
Named pipe basics
creating,
Named Pipes (Fifos)
defined,
Interprocess Communication
,
Anonymous Pipes
use cases,
Named pipe use cases
namespaces,
Running Code Strings with Results and Namespaces
,
Running Code Strings with Results and Namespaces
,
Running Strings in Dictionaries
creating,
Running Strings in Dictionaries
running code strings with,
Running Code Strings with Results and Namespaces
,
Running Code Strings with Results and Namespaces
natural language processing,
Advanced Language Tools
nested structures,
Nested structures
,
Uploading Local Trees
,
Uploading Local Trees
,
Pickled Objects
,
Pickling in Action
dictionaries,
Nested structures
pickling,
Pickled Objects
,
Pickling in Action
uploading local trees,
Uploading Local Trees
,
Uploading Local Trees
Network News Transfer Protocol (NNTP),
NNTP: Accessing Newsgroups
,
NNTP: Accessing Newsgroups
,
More Than One Way to Push Bits over the Net
network scripting,
Python Internet Development Options
,
Python Internet Development Options
,
The Socket Layer
,
Machine identifiers
,
The Protocol Layer
,
Protocol structures
,
Python’s Internet Library Modules
,
Python’s Internet Library Modules
,
Socket Programming
,
Binding reserved port servers
,
Handling Multiple Clients
,
Summary: Choosing a Server Scheme
,
Making Sockets Look Like Files and Streams
,
Sockets versus command pipes
,
A Simple Python File Server
,
Using a reusable form-layout class
development options,
Python Internet Development Options
,
Python Internet Development Options
handling multiple clients,
Handling Multiple Clients
,
Summary: Choosing a Server Scheme
library modules and,
Python’s Internet Library Modules
,
Python’s Internet Library Modules
making sockets look like files/streams,
Making Sockets Look Like Files and Streams
,
Sockets versus command pipes
protocols and,
The Protocol Layer
,
Protocol structures
Python file server,
A Simple Python File Server
,
Using a reusable form-layout class
sockets and,
The Socket Layer
,
Machine identifiers
,
Socket Programming
,
Binding reserved port servers
newsgroups,
NNTP: Accessing Newsgroups
,
NNTP: Accessing Newsgroups
,
Ideas for Improvement
accessing,
NNTP: Accessing Newsgroups
,
NNTP: Accessing Newsgroups
handling messages,
Ideas for Improvement
NLTK suite,
Advanced Language Tools
NNTP (Network News Transfer Protocol),
NNTP: Accessing Newsgroups
,
NNTP: Accessing Newsgroups
,
More Than One Way to Push Bits over the Net
nntplib module,
Python’s Internet Library Modules
,
NNTP: Accessing Newsgroups
,
NNTP: Accessing Newsgroups
numeric tools,
A Quick Geometry Lesson
NumPy programming extension,
A Quick Geometry Lesson
,
Extending and Embedding
O
object references,
Deferring Calls with Lambdas and Object References
,
Deferring Calls with Lambdas and Object References
,
Reloading Callback Handlers Dynamically
callback handlers as,
Reloading Callback Handlers Dynamically
deferring calls,
Deferring Calls with Lambdas and Object References
,
Deferring Calls with Lambdas and Object References
object relational mappers,
Other Database Options
(see ORMs)
Object Request Broker (ORB),
Python Internet Development Options
object types, storing in shelves,
Storing Built-in Object Types in Shelves
object-oriented databases (OODBs),
Persistence Options in Python
object-oriented programming,
Step 3: Stepping Up to OOP
(see OOP)
objects,
Step 1: Sharing Objects Between Pages—A New Input Form
,
Step 1: Sharing Objects Between Pages—A New Input Form
,
Persistence Options in Python
,
Pickled Objects
,
Pickle Details: Protocols, Binary Modes, and _pickle
,
Pickled Objects
,
Changing Classes of Objects Stored in Shelves
,
Objects are unique only within a key
,
What Is Embedded Code?
,
Calling Python Objects
,
Calling Python Objects
,
Registering Callback Handler Objects
,
Registration Implementation
callable,
What Is Embedded Code?
,
Calling Python Objects
,
Calling Python Objects
,
Registering Callback Handler Objects
,
Registration Implementation
changing classes,
Changing Classes of Objects Stored in Shelves
converting to strings,
Pickled Objects
pickled,
Persistence Options in Python
,
Pickled Objects
,
Pickle Details: Protocols, Binary Modes, and _pickle
sharing between pages,
Step 1: Sharing Objects Between Pages—A New Input Form
,
Step 1: Sharing Objects Between Pages—A New Input Form
shelve constraints,
Objects are unique only within a key
offline processing, PyMailGUI program,
Offline Processing with Save and Open
,
Offline Processing with Save and Open
onSignal handler function,
Signals
OODBs (object-oriented databases),
Persistence Options in Python
OOP (object-oriented programming),
Step 3: Stepping Up to OOP
,
Step 3: Stepping Up to OOP
,
Using Classes
,
Using Classes
,
Adding Behavior
,
Adding Inheritance
,
Refactoring Code
,
Alternative classes
,
Adding Persistence
,
Adding Persistence
,
Other Database Options
,
Using OOP for GUIs
,
Using OOP for GUIs
,
Python Is OOP Done Right
adding behavior,
Adding Behavior
adding inheritance,
Adding Inheritance
adding persistence,
Adding Persistence
,
Adding Persistence
alternative database options,
Other Database Options
class considerations,
Using Classes
,
Using Classes
GUI considerations,
Using OOP for GUIs
,
Using OOP for GUIs
programming considerations,
Step 3: Stepping Up to OOP
,
Step 3: Stepping Up to OOP
,
Python Is OOP Done Right
refactoring code,
Refactoring Code
,
Alternative classes
open function,
File Tools
,
Using Built-in File Objects
,
Other open options
,
Other open options
buffering policy,
Other open options
functionality,
File Tools
,
Using Built-in File Objects
modes supported,
Other open options
open source software,
This Chapter’s Strategy
,
Python’s Internet Library Modules
opening files,
Opening
,
Other open options
optimization,
Optimization: Tuple Tree Stacks
,
Optimization: Tuple Tree Stacks
,
Optimization: In-Place List Modifications
,
Optimization: In-Place List Modifications
,
Optimization: Moving Sets to Dictionaries
,
Timing the results under Python 3.1
in-place list modifications,
Optimization: In-Place List Modifications
,
Optimization: In-Place List Modifications
moving sets to dictionaries,
Optimization: Moving Sets to Dictionaries
,
Timing the results under Python 3.1
tuple tree stacks,
Optimization: Tuple Tree Stacks
,
Optimization: Tuple Tree Stacks
Optionmenu widget class,
Using Menubuttons and Optionmenus
optparse module,
Parsing Command-Line Arguments
ORB (Object Request Broker),
Python Internet Development Options
ORMs (object relational mappers),
Other Database Options
,
Python Internet Development Options
,
Persistence Options in Python
,
ORMs: Object Relational Mappers
,
ORMs: Object Relational Mappers
database options,
Other Database Options
,
Python Internet Development Options
functionality,
Persistence Options in Python
,
ORMs: Object Relational Mappers
,
ORMs: Object Relational Mappers
os module,
System Scripting Overview
,
Python System Modules
,
Introducing the os Module
,
Tools in the os Module
,
Administrative Tools
,
Administrative Tools
,
Administrative Tools
,
Administrative Tools
,
Portability Constants
,
Portability Constants
,
Portability Constants
,
Portability Constants
,
Running Shell Commands from Scripts
,
Shell command limitations
,
Running Shell Commands from Scripts
,
Running Shell Commands from Scripts
,
Communicating with shell commands
,
Communicating with shell commands
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
Other os Module Exports
,
“I’d Like to Have an Argument, Please”
,
“I’d Like to Have an Argument, Please”
,
“I’d Like to Have an Argument, Please”
,
Current Working Directory
,
Shell Environment Variables
,
Changing Shell Variables
,
Changing Shell Variables
,
Changing Shell Variables
,
Shell Variable Fine Points: Parents, putenv, and getenv
,
Shell Variable Fine Points: Parents, putenv, and getenv
,
Other Redirection Options: os.popen and subprocess
Revisited
,
Redirecting input or output with os.popen
,
Redirecting input and output with subprocess
,
Redirecting input and output with subprocess
,
Redirecting input and output with subprocess
,
Lower-Level File Tools in the os Module
,
Lower-Level File Tools in the os Module
,
Lower-Level File Tools in the os Module
,
Lower-Level File Tools in the os Module
,
Lower-Level File Tools in the os Module
,
Using os.open files
,
os.open mode flags
,
Wrapping descriptors in file objects
,
Other os module file tools
,
Other os module file tools
,
Other os module file tools
,
Other os module file tools
,
Other os module file tools
,
Running shell listing commands with os.popen
,
Running shell listing commands with os.popen
,
The os.listdir call
,
The os.walk visitor
,
The os.walk visitor
,
Recursive os.listdir traversals
,
Handling Unicode Filenames in 3.X: listdir, walk, glob
,
Handling Unicode Filenames in 3.X: listdir, walk, glob
,
Forking Processes
,
Forking Processes
,
Forking Processes
,
The fork/exec Combination
,
Spawned child program
,
The fork/exec Combination
,
Spawned child program
,
os.exec call formats
,
os.exec call formats
,
os.exec call formats
,
os.exec call formats
,
os.exec call formats
,
os.exec call formats
,
os.exec call formats
,
os.exec call formats
,
os Module Exits
,
os Module Exits
,
Exit status with os.system and os.popen
,
Exit status with os.system and os.popen
,
Anonymous pipe basics
,
Wrapping pipe descriptors in file objects
,
Bidirectional IPC with anonymous pipes
,
Bidirectional IPC with anonymous pipes
,
Bidirectional IPC with anonymous pipes
,
Bidirectional IPC with anonymous pipes
,
Bidirectional IPC with anonymous pipes
,
Named pipe basics
,
Signals
,
The os.spawn Calls
,
The os.spawn Calls
,
The os.spawn Calls
,
The os.spawn Calls
,
The os.startfile call
,
Scanning the Standard Library Tree
,
Printing Unicode Filenames
,
Joining Files Portably
,
Rolling Your Own find Module
,
Preventing zombies with signal handlers on Linux
,
Downloading Site Directories
,
Uploading Site Directories
,
SMTP: Sending Email
,
Handling private files and errors
,
Wrapping C Environment Calls
,
Wrapping C Environment Calls
,
Adding Wrapper Classes to Flat Libraries
administrative tools,
Administrative Tools
chdir function,
Administrative Tools
,
Current Working Directory
chmod function,
Other os module file tools
close function,
Bidirectional IPC with anonymous pipes
dup function,
Redirecting input and output with subprocess
dup2 function,
Bidirectional IPC with anonymous pipes
environ mapping,
Other os Module Exports
,
“I’d Like to Have an Argument, Please”
,
Shell Environment Variables
,
Changing Shell Variables
,
Wrapping C Environment Calls
,
Adding Wrapper Classes to Flat Libraries
accessing environment variables,
Wrapping C Environment Calls
accessing shell variables,
Shell Environment Variables
changing shell variables,
Changing Shell Variables
Env object,
Adding Wrapper Classes to Flat Libraries
functionality,
Other os Module Exports
,
“I’d Like to Have an Argument, Please”
execl function,
os.exec call formats
execle function,
os.exec call formats
execlp function,
Other os Module Exports
,
The fork/exec Combination
,
Spawned child program
,
os.exec call formats
execlpe function,
os.exec call formats
execv function,
os.exec call formats
execve function,
os.exec call formats
execvp function,
os.exec call formats
,
Bidirectional IPC with anonymous pipes
execvpe function,
os.exec call formats
_exit function,
os Module Exits
fdopen function,
Wrapping descriptors in file objects
,
Wrapping pipe descriptors in file objects
file tools supported,
Lower-Level File Tools in the os Module
fork function,
Other os Module Exports
,
Redirecting input and output with subprocess
,
Forking Processes
,
The fork/exec Combination
,
Spawned child program
,
Bidirectional IPC with anonymous pipes
functionality,
Other os Module Exports
,
Forking Processes
,
Bidirectional IPC with anonymous pipes
os.execlp combination,
The fork/exec Combination
,
Spawned child program
redirecting streams,
Redirecting input and output with subprocess
forking tools,
Forking Processes
functionality,
System Scripting Overview
,
Python System Modules
,
Introducing the os Module
getcwd function,
Administrative Tools
,
“I’d Like to Have an Argument, Please”
getenv function,
Shell Variable Fine Points: Parents, putenv, and getenv
getpid function,
Administrative Tools
,
Forking Processes
kill function,
Signals
,
Preventing zombies with signal handlers on Linux
linesep character,
Portability Constants
listdir function,
The os.listdir call
,
Recursive os.listdir traversals
,
Handling Unicode Filenames in 3.X: listdir, walk, glob
,
Printing Unicode Filenames
,
Joining Files Portably
,
Downloading Site Directories
,
Uploading Site Directories
fetching list of remote files,
Downloading Site Directories
handling Unicode filenames,
Handling Unicode Filenames in 3.X: listdir, walk, glob
joining files,
Joining Files Portably
printing Unicode filenames,
Printing Unicode Filenames
storing local files,
Uploading Site Directories
walking directory trees,
Recursive os.listdir traversals
walking one directory,
The os.listdir call
lseek function,
Lower-Level File Tools in the os Module
mkdir function,
Other os Module Exports
mkfifo function,
Other os Module Exports
,
Named pipe basics
open function,
Other os Module Exports
,
Lower-Level File Tools in the os Module
,
Using os.open files
,
os.open mode flags
pathsep character,
Portability Constants
pipe function,
Other os Module Exports
,
Redirecting input and output with subprocess
,
Anonymous pipe basics
,
Bidirectional IPC with anonymous pipes
file descriptors and,
Anonymous pipe basics
functionality,
Other os Module Exports
,
Bidirectional IPC with anonymous pipes
redirecting output,
Redirecting input and output with subprocess
popen function,
Running Shell Commands from Scripts
,
Communicating with shell commands
,
“I’d Like to Have an Argument, Please”
,
Other Redirection Options: os.popen and subprocess
Revisited
,
Redirecting input or output with os.popen
,
Running shell listing commands with os.popen
,
Running shell listing commands with os.popen
,
Exit status with os.system and os.popen
,
SMTP: Sending Email
communicating with,
Communicating with shell commands
exit status,
Exit status with os.system and os.popen
functionality,
Running Shell Commands from Scripts
launching mail program,
SMTP: Sending Email
redirecting streams,
Other Redirection Options: os.popen and subprocess
Revisited
,
Redirecting input or output with os.popen
shell listing command,
Running shell listing commands with os.popen
,
Running shell listing commands with os.popen
standard streams and,
“I’d Like to Have an Argument, Please”
portability constants,
Portability Constants
program exits,
os Module Exits
putenv function,
Shell Variable Fine Points: Parents, putenv, and getenv
,
Wrapping C Environment Calls
read function,
Lower-Level File Tools in the os Module
remove function,
Other os Module Exports
,
Other os module file tools
rename function,
Other os module file tools
sep character,
Portability Constants
shell commands from scripts,
Running Shell Commands from Scripts
,
Shell command limitations
spawnv function,
Other os Module Exports
,
Changing Shell Variables
,
The os.spawn Calls
,
The os.spawn Calls
spawnve function,
Changing Shell Variables
,
The os.spawn Calls
,
The os.spawn Calls
startfile function,
The os.startfile call
stat function,
Other os Module Exports
,
Other os module file tools
,
Handling private files and errors
system function,
Running Shell Commands from Scripts
,
Communicating with shell commands
,
Exit status with os.system and os.popen
tools by functional area,
Tools in the os Module
unlink function,
Other os module file tools
walk function,
Other os Module Exports
,
The os.walk visitor
,
The os.walk visitor
,
Handling Unicode Filenames in 3.X: listdir, walk, glob
,
Scanning the Standard Library Tree
,
Rolling Your Own find Module
find function and,
Rolling Your Own find Module
functionality,
Other os Module Exports
handling Unicode filenames,
Handling Unicode Filenames in 3.X: listdir, walk, glob
scanning directory trees,
The os.walk visitor
,
The os.walk visitor
,
Scanning the Standard Library Tree
write function,
Lower-Level File Tools in the os Module
BOOK: Programming Python
5.29Mb size Format: txt, pdf, ePub
ads

Other books

The Witch's Daughter by R. A. Salvatore
Close Call by J.M. Gregson
A Dual Inheritance by Joanna Hershon
Rex Stout by Red Threads
Winning the Right Brother by Abigail Strom