Foreword
Preface
1. Introduction
Why Python?
Motivation
The Basics
Executing Statements in Python
Using Functions in Python
Reusing Code with the Import Statement
2. IPython
Installing IPython
Basic Concepts
Help with Magic Functions
Unix Shell
Information Gathering
Automation and Shortcuts
Summary
3. Text
Python Built-ins and Modules
Log Parsing
ElementTree
Summary
4. Documentation and Reporting
Automated Information Gathering
Manual Information Gathering
Information Formatting
Information Distribution
Summary
5. Networking
Network Clients
Remote Procedure Call Facilities
SSH
Twisted
Scapy
Creating Scripts with Scapy
6. Data
Introduction
Using the OS Module to Interact with Data
Copying, Moving, Renaming, and Deleting Data
Working with Paths, Directories, and Files
Comparing Data
Merging Data
Pattern Matching Files and Directories
Wrapping Up rsync
Metadata: Data About Data
Archiving, Compressing, Imaging, and Restoring
Using tarfile Module to Create TAR Archives
Using a tarfile Module to Examine the Contents of TAR Files
7. SNMP
Introduction
Brief Introduction to SNMP
IPython and Net-SNMP
Discovering a Data Center
Retrieving Multiple-Values with Net-SNMP
Creating Hybrid SNMP Tools
Extending Net-SNMP
SNMP Device Control
Enterprise SNMP Integration with Zenoss
8. OS Soup
Introduction
Cross-Platform Unix Programming in Python
PyInotify
OS X
Red Hat Linux Systems Administration
Ubuntu Administration
Solaris Systems Administration
Virtualization
Cloud Computing
Using Zenoss to Manage Windows Servers from Linux
9. Package Management
Introduction
Setuptools and Python Eggs
Using easy_install
easy_install Advanced Features
Creating Eggs
Entry Points and Console Scripts
Registering a Package with the Python Package Index
Distutils
Buildout
Using Buildout
Developing with Buildout
virtualenv
EPM Package Manager
10. Processes and Concurrency
Introduction
Subprocess
Using Supervisor to Manage Processes
Using Screen to Manage Processes
Threads in Python
Processes
Processing Module
Scheduling Python Processes
daemonizer
Summary
11. Building GUIs
GUI Building Theory
Building a Simple PyGTK App
Building an Apache Log Viewer Using PyGTK
Building an Apache Log Viewer Using Curses
Web Applications
Django
Conclusion
12. Data Persistence
Simple Serialization
Relational Serialization
Summary
13. Command Line
Introduction
Basic Standard Input Usage
Introduction to Optparse
Simple Optparse Usage Patterns
Unix Mashups: Integrating Shell Commands into Python Command-Line Tools
Integrating Configuration Files
Summary
14. Pragmatic Examples
Managing DNS with Python
Using LDAP with OpenLDAP, Active Directory, and More with Python 406
Apache Log Reporting
FTP Mirror
Appendix: Callbacks
Index