Read Programming Python Online

Authors: Mark Lutz

Tags: #COMPUTERS / Programming Languages / Python

Programming Python (205 page)

BOOK: Programming Python
2.61Mb size Format: txt, pdf, ePub
ads
(see also PyMailCGI program; server-side scripting/processing)
adding common input devices,
Adding Common Input Devices
,
Adding Common Input Devices
adding pictures,
Adding Pictures and Generating Tables
,
Table tags
adding user interaction,
Adding User Interaction
,
Testing outside browsers with the module urllib.request
building first web page,
A First Web Page
,
HTML file permission constraints
changing input layouts,
Changing Input Layouts
,
Keeping display and logic separate
checking inputs,
Checking for Missing and Invalid Inputs
,
Checking for Missing and Invalid Inputs
converting strings,
Converting strings in CGI scripts
debugging,
Debugging CGI scripts
,
Debugging CGI scripts
defined,
The Script Behind the Curtain
escape conventions,
More on HTML and URL Escapes
,
Avoiding conflicts
examples,
A First CGI Script
,
Finding Python on remote servers
formatting reply text,
Formatting Reply Text
functionality,
CGI Basics
,
GUIs versus the Web
,
Python Internet Development Options
,
What’s a Server-Side CGI Script?
,
The Script Behind the Curtain
functions and,
Passing parameters in URLs
generating tables,
Adding Pictures and Generating Tables
,
Table tags
Hello World program,
The Hello World Selector
,
Checking for Missing and Invalid Inputs
installing,
Installing CGI scripts
,
Installing CGI scripts
laying out forms with tables,
Using Tables to Lay Out Forms
,
Debugging CGI scripts
model extensions,
Extensions to the CGI Model
name conventions,
Installing CGI scripts
passing parameters in hidden form fields,
Passing Parameters in Hidden Form Fields
passing parameters in URLs,
Passing Parameters in Hardcoded URLs
,
Passing Parameters in Hardcoded URLs
permissions,
Handling private files and errors
programming suggestions,
Future directions
query strings,
Using Query Strings and urllib
,
Using Query Strings and urllib
refactoring code,
Refactoring Code for Maintainability
,
Step 3: Putting It All Together—A New Reply Script
running,
Running Server-Side Examples
,
Viewing Server-Side Examples and Output
saving state information in,
Saving State Information in CGI Scripts
,
Combining Techniques
text decoding issues,
Parser decoding requirement
urllib module and,
Using Query Strings and urllib
,
Using Query Strings and urllib
using cookies in,
Using cookies in CGI scripts
web servers and,
Running a Web Server
,
Running a Web Server
writing,
Writing CGI Scripts in Python
,
Writing CGI Scripts in Python
Checkbutton widget class,
The End of the Tutorial
,
Checkbuttons
,
Check buttons and variables
,
Checkbuttons
,
Check buttons and variables
,
Check buttons and variables
command option,
Checkbuttons
functionality,
The End of the Tutorial
,
Checkbuttons
,
Check buttons and variables
variables and,
Check buttons and variables
,
Check buttons and variables
child process,
Forking Processes
,
Spawned child program
,
Exiting from children
defined,
Forking Processes
exiting from,
Exiting from children
spawning,
Spawned child program
chmod command,
Script start-up pointers
,
CGI Basics
,
HTML file permission constraints
class instances,
Persistence Options in Python
,
Pickling in Action
,
Storing Class Instances in Shelves
,
Storing Class Instances in Shelves
persistence and,
Persistence Options in Python
pickling,
Pickling in Action
storing in shelves,
Storing Class Instances in Shelves
,
Storing Class Instances in Shelves
class object callback handlers,
Callable Class Object Callback Handlers
classes,
Using Classes
,
Using Classes
,
Adding Behavior
,
Adding Inheritance
,
Alternative classes
,
Adding Persistence
,
Adding Persistence
,
Customizing Widgets with Classes
,
Common appearance
,
Reusable GUI Components with Classes
,
Standalone Container Classes
,
Standalone Container Classes
,
Standalone Container Classes
,
Recoding with classes and bound methods
,
Recoding with classes and bound methods
,
Refactoring with classes
,
Refactoring with classes
,
Changing Classes of Objects Stored in Shelves
,
A Stack Class
,
A Stack Class
,
Set Classes
,
Set Classes
,
Moving Graphs to Classes
,
Moving Graphs to Classes
,
Using Python Classes in C
,
Using Python Classes in C
adding behavior,
Adding Behavior
adding inheritance,
Adding Inheritance
adding persistence,
Adding Persistence
,
Adding Persistence
alternative,
Alternative classes
C language and,
Using Python Classes in C
,
Using Python Classes in C
changing for objects,
Changing Classes of Objects Stored in Shelves
container,
Standalone Container Classes
,
Standalone Container Classes
customizing widgets with,
Customizing Widgets with Classes
,
Common appearance
moving graphs to,
Moving Graphs to Classes
,
Moving Graphs to Classes
programming considerations,
Using Classes
,
Using Classes
recoding with,
Recoding with classes and bound methods
,
Recoding with classes and bound methods
refactoring scripts with,
Refactoring with classes
,
Refactoring with classes
reusable GUI components,
Reusable GUI Components with Classes
,
Standalone Container Classes
sets and,
Set Classes
,
Set Classes
stacks and,
A Stack Class
,
A Stack Class
client-side scripting/processing,
Python Internet Development Options
,
Clients and servers
,
Client socket calls
,
Spawning Clients in Parallel
,
Preview: Denied client connections
,
Handling Multiple Clients
,
Summary: Choosing a Server Scheme
,
“Socket to Me!”
,
FTP: Transferring Files over the Net
,
Transferring Files with ftplib
,
Adding a User Interface
,
Transferring Directories with ftplib
,
Refactoring with classes
,
Transferring Directory Trees with ftplib
,
Downloading Remote Trees
,
Processing Internet Email
,
Unicode in Python 3.X and Email Tools
,
POP: Fetching Email
,
Fetching Email at the Interactive Prompt
,
SMTP: Sending Email
,
Sending Email at the Interactive Prompt
,
email: Parsing and Composing Mail Content
,
Summary: Solutions and workarounds
,
A Console-Based Email Client
,
Running the pymail Console Client
,
The mailtools Utility Package
,
Running the pymail2 console client
,
NNTP: Accessing Newsgroups
,
NNTP: Accessing Newsgroups
,
HTTP: Accessing Websites
,
HTTP: Accessing Websites
,
The urllib Package Revisited
,
Invoking programs and escaping text
,
Other Client-Side Scripting Options
,
“Use the Source, Luke”
,
Other Approaches
accessing newsgroups,
NNTP: Accessing Newsgroups
,
NNTP: Accessing Newsgroups
accessing websites,
HTTP: Accessing Websites
,
HTTP: Accessing Websites
additional options,
Other Client-Side Scripting Options
client socket calls,
Client socket calls
console-based email client,
A Console-Based Email Client
,
Running the pymail Console Client
development options,
Python Internet Development Options
fetching email via POP,
POP: Fetching Email
,
Fetching Email at the Interactive Prompt
handling multiple clients,
Handling Multiple Clients
,
Summary: Choosing a Server Scheme
Internet applications and,
Other Approaches
mailtools utility package,
The mailtools Utility Package
,
Running the pymail2 console client
parsing/composing mail content,
email: Parsing and Composing Mail Content
,
Summary: Solutions and workarounds
processing Internet email,
Processing Internet Email
,
Unicode in Python 3.X and Email Tools
protocol considerations,
Clients and servers
PyMailGUI program and,
“Use the Source, Luke”
Python support,
“Socket to Me!”
sending email via SMTP,
SMTP: Sending Email
,
Sending Email at the Interactive Prompt
spawning clients in parallel,
Spawning Clients in Parallel
,
Preview: Denied client connections
transferring directories with ftplib,
Transferring Directories with ftplib
,
Refactoring with classes
transferring directory trees,
Transferring Directory Trees with ftplib
,
Downloading Remote Trees
transferring files over the Internet,
FTP: Transferring Files over the Net
transferring files with ftplib,
Transferring Files with ftplib
,
Adding a User Interface
urllib module,
The urllib Package Revisited
,
Invoking programs and escaping text
client/server architecture,
Clients and servers
,
Transferring Files to Clients and Servers
,
More Than One Way to Push Bits over the Net
defined,
Clients and servers
transferring files,
Transferring Files to Clients and Servers
,
More Than One Way to Push Bits over the Net
clipboard interface,
Using the clipboard
clipping widgets,
Widget Resizing Revisited: Clipping
closing files,
Closing
,
Ensuring file closure: Exception handlers and context
managers
,
Input files
cloud computing,
Python Internet Development Options
code files,
What Is Embedded Code?
code strings,
What Is Embedded Code?
,
Running Simple Code Strings
,
Compiling and running
,
Running Code Strings with Results and Namespaces
,
Running Code Strings with Results and Namespaces
,
Running Strings in Dictionaries
,
Precompiling Strings to Bytecode
,
Precompiling Strings to Bytecode
defined,
What Is Embedded Code?
precompiling,
Precompiling Strings to Bytecode
,
Precompiling Strings to Bytecode
running in dictionaries,
Running Strings in Dictionaries
running simple,
Running Simple Code Strings
,
Compiling and running
running with results/namespaces,
Running Code Strings with Results and Namespaces
,
Running Code Strings with Results and Namespaces
colors, selecting on the fly,
Letting users select colors on the fly
columns in files, summing,
Summing Columns in a File
,
Summing with dictionaries
COM (Component Object Model),
Python Internet Development Options
,
Other Integration Topics
command-line arguments,
“I’d Like to Have an Argument, Please”
,
Command-Line Arguments
,
Parsing Command-Line Arguments
,
Parsing Command-Line Arguments
accessing,
“I’d Like to Have an Argument, Please”
parsing,
Parsing Command-Line Arguments
sys module and,
Command-Line Arguments
,
Parsing Command-Line Arguments
command-line pipes,
Output stream buffering revisited: Deadlocks and
flushes
,
Adding a GUI As a Separate Program: Command Pipes
,
Other uses for threaded pipe GUIs
,
Buffering in other contexts: Command pipes revisited
,
Sockets versus command pipes
buffering and,
Output stream buffering revisited: Deadlocks and
flushes
,
Buffering in other contexts: Command pipes revisited
GUI programs and,
Adding a GUI As a Separate Program: Command Pipes
,
Other uses for threaded pipe GUIs
sockets and,
Sockets versus command pipes
BOOK: Programming Python
2.61Mb size Format: txt, pdf, ePub
ads

Other books

Hunter and the Trap by Howard Fast
Pampered to Death by Laura Levine
The Siren of Paris by David Leroy
The Reluctant Earl by Joan Wolf
The Way to Yesterday by Sharon Sala
The Violent Years by Paul R. Kavieff
All Backs Were Turned by Marek Hlasko