Home Page Icon
Home Page
Table of Contents for
II. Advanced Topics
Close
II. Advanced Topics
by Jim Knowlton
Python® Create-Modify-Reuse
Copyright
About the Author
Credits
Acknowledgments
Introduction
0.1. Who This Book Is For
0.2. What This Book Covers
0.3. How This Book Is Structured
0.4. What You Need to Use This Book
0.5. Source Code
0.6. Errata
0.7. p2p.wrox.com
1. A Python Primer
1.1. Getting Started
1.1.1. Obtaining Python and Installing It
1.1.2. The Python Interpreter
1.1.3. Your Editing/Execution Environment
1.2. Lexical Structure
1.2.1. Keywords
1.2.2. Lines and Indentation
1.2.3. Data Types and Identifiers
1.2.3.1. Data Types
1.2.3.2. Identifiers
1.3. Operators
1.4. Expressions and Statements
1.4.1. Expressions
1.4.1.1. Operator Precedence in Expressions
1.4.2. Statements
1.4.2.1. Multi-line Statements
1.5. Iteration and Decision-Making
1.5.1. Iteration
1.5.1.1. For Loops
1.5.1.2. While Loops
1.5.1.3. Break and Continue
1.5.2. Decision-Making
1.5.2.1. The if Statement
1.6. Functions
1.6.1.
1.6.1.1. Defining a Function
1.6.1.2. Calling a Function
1.7. Modules
1.7.1. Importing Modules
1.7.1.1. Import
1.7.1.2. Reload
1.7.2. How Python Finds Modules to Load
1.7.2.1. The Module Search Path
1.7.2.2. Exploring sys.path
1.8. Classes
1.9. Summary
I. The Projects
2. Directory/File Snapshot Program
2.1. Using the Program
2.1.1. Creating a Snapshot
2.1.2. Listing Snapshot Files
2.1.3. Comparing Snapshots
2.1.4. Viewing Help
2.1.5. Exiting the Program
2.1.6. Putting It All Together
2.1.6.1. Other Applications of the Program
2.2. Design
2.2.1. How It All Fits Together
2.2.2. Main Program
2.2.3. Modules
2.2.3.1. snapshot Module
2.2.3.2. snapshothelper Module
2.3. Code and Code Explanation
2.3.1. Snapshot.py
2.3.1.1. Program Header
2.3.1.2. Import Statements
2.3.1.3. The Main Program
2.3.1.4. The menu() Function
2.3.2. snapshothelper.py
2.3.2.1. createSnapshot(directory, filename)
2.3.2.2. listSnapshot(extension)
2.3.2.3. compareSnapshots(snapfile1, snapfile2)
2.3.2.4. showHelp()
2.3.2.5. invalidChoice()
2.3.2.6. printList()
2.4. Testing
2.5. Modifying the Program
2.6. Summary
3. DVD Inventory System
3.1. Using the Program
3.1.1. Installing MySQL
3.1.2. Adding a DVD to the Database
3.1.2.1. When Problems Occur
3.1.3. Searching the DVD Inventory
3.1.3.1. Lookup by Movie Title
3.1.3.2. Lookup by Star
3.1.3.3. Lookup by Costar
3.1.3.4. Lookup by Year Released
3.1.3.5. Lookup by genre
3.1.3.6. When Problems Occur
3.1.4. Modifying a DVD Record
3.1.4.1. Modify Title
3.1.4.2. Modify Star
3.1.4.3. Modify Costar
3.1.4.4. Modify Year
3.1.4.5. Modify Genre
3.1.4.6. When Problems Occur
3.1.5. Deleting a DVD Record
3.1.5.1. When Problems Occur
3.1.6. Exporting the List of DVDs to a CSV File
3.2. Design
3.2.1. How It All Fits Together
3.2.2. Modules
3.2.2.1. dvd.py
3.2.2.2. add_dvd.py
3.2.2.3. lookup_dvds.py
3.2.2.4. modify_dvd.py
3.2.2.5. delete_dvd.py
3.2.2.6. csvreport_dvd.py
3.3. Code and Code Explanation
3.3.1. dvd.py
3.3.1.1. The main() Function
3.3.1.2. Menu()
3.3.2. add_dvd.py
3.3.2.1. AddDVD()
3.3.2.2. SQLAddDVD(Title, Star, Costar, Year, Genre)
3.3.3. lookup_dvds.py
3.3.3.1. LookupDVD()
3.3.3.2. SQLLookupDVD(searchby, searchtext)
3.3.4. modify_dvd.py
3.3.4.1. ModifyDVD()
3.3.5. delete_dvd.py
3.3.5.1. DeleteDVD()
3.3.5.2. SQLDeleteDVD(dvdToDelete)
3.3.6. csvreport_dvd.py
3.3.6.1. WriteCSV()
3.4. Testing
3.5. Modifying the Program
3.6. Summary
4. Web Performance Tester
4.1. Using the Program
4.1.1. Running the Python Web Server
4.1.1.1. When Problems Occur
4.1.2. Running the Performance Profiler Client
4.1.2.1. Testing Connection Performance to External Websites
4.1.2.2. Testing Internal Web Server Performance
4.1.2.3. Displaying the Log File
4.1.2.4. When Problems Occur
4.2. Design
4.2.1. How It All Fits Together
4.2.2. Modules
4.2.2.1. webserver.py
4.2.2.2. webperf.py
4.2.2.3. webclient.py
4.3. Code and Code Explanation
4.3.1. webserver.py
4.3.1.1. Main()
4.3.1.2. RunServer()
4.3.2. webperf.py
4.3.2.1. Main()
4.3.2.2. Menu()
4.3.3. webclient.py
4.3.3.1. CheckExternalSites(sites)
4.3.3.2. CheckInternalWebServers(serverlist, port)
4.3.3.3. Other Support Files
4.4. Testing
4.5. Modifying the Program
4.6. Summary
5. Customer Follow-Up System
5.1. Using the Program
5.1.1. Preliminaries
5.1.1.1. Installing Apache
5.1.1.2. Installing mod_python
5.1.1.3. Configuring Apache for mod_python
5.1.1.4. Copying Program Files into Their Proper Directories
5.1.2. Running the Program
5.1.2.1. Entering Comments at the Website
5.1.2.2. When Problems Occur
5.1.2.3. Viewing and Sorting the Log File
5.2. Design
5.2.1. How It All Fits Together
5.2.2. Modules
5.2.2.1. form.py
5.3. Code and Code Explanation
5.3.1. form.html
5.3.2. form.py
5.3.2.1. The email(req, name, phone, email, comment)
5.3.2.2. writeCSVLog(name, phone, email, comment)
5.4. Testing
5.5. Modifying the Program
5.6. Summary
6. Test Management/Reporting System
6.1. Using the Program
6.1.1. Running Tests
6.1.1.1. How Test Results Are Stored
6.1.1.2. What If Some Tests Fail?
6.1.2. Listing Test Runs
6.1.3. Showing Test Results
6.1.3.1. When Problems Occur
6.1.4. Generating an HTML Test Report
6.1.5. Examining the HTML File
6.1.5.1. When Problems Occur
6.1.6. Displaying Product Help
6.2. Design
6.2.1. Modules
6.2.1.1. test_manager.py
6.2.1.2. test_run.py
6.2.1.3. test_list.py
6.2.1.4. test_results.py
6.2.1.5. test_html.py
6.3. Code and Code Explanation
6.3.1. test_manager.py
6.3.1.1. Main Program
6.3.1.2. menu()
6.3.2. test_run.py
6.3.2.1. test_firstname(fname)
6.3.2.2. test_lastname(lname)
6.3.2.3. test_prime_number()
6.3.2.4. run_tests()
6.3.2.5. testcount()
6.3.3. test_list.py
6.3.3.1. list_tests()
6.3.4. test_results.py
6.3.4.1. show_test_results()
6.3.5. test_html.py
6.3.5.1. test_html_report ()
6.4. Testing
6.5. Modifying the Program
6.6. Summary
6.6.1. More About the Minidom Module
7. Version Management System
7.1. Using the Program
7.1.1. Setting Up Remote Computers
7.1.2. Running the Program — Command-Line Syntax
7.1.2.1. Command-Line Examples
7.1.2.2. Viewing the CSV Log File
7.1.2.3. Running Against Several Different Machines in Batch Mode
7.2. Design
7.2.1. Modules
7.2.1.1. version_checker.py
7.2.1.2. check_versions.py
7.2.1.3. csv_report.py
7.3. Code and Code Explanation
7.3.1. version_checker.py
7.3.1.1. Main Program
7.3.1.2. check_arguments()
7.3.1.3. get_versions()
7.3.2. check_versions.py
7.3.2.1. check_java()
7.3.2.2. check_python()
7.3.2.3. check_perl()
7.3.3. csv_report.py
7.3.3.1. write_csv_log()
7.4. Testing
7.5. Modifying the Program
7.5.1. Security Considerations
7.6. Summary
8. Content Management System
8.1. Plone Overview
8.1.1. What Is Plone?
8.2. Installing and Configuring Plone
8.2.1. Downloading Plone
8.2.2. Extracting the Plone Install
8.2.3. Running the Plone Install
8.2.4. Starting Plone
8.2.5. Discovering the Admin User Password
8.2.6. Logging In as the Admin User
8.2.7. Setting Up the E-mail Server
8.2.8. Setting Up a User
8.2.9. Logging In as the Set-Up User
8.3. Design
8.4. Navigation
8.5. Content Management
8.5.1. Creating a Page
8.5.2. Creating a Collection
8.6. User Permissions
8.7. Summary
II. Advanced Topics
9. Interacting with the Operating System
9.1. Generic Operating System Services
9.1.1. The os Module — Generic OS Services
9.1.1.1. Examples
9.1.1.1.1. Example 1
9.1.1.1.2. Example 2
9.1.2. The time Module — Format and Manipulate System Time
9.1.2.1. Examples
9.1.2.1.1. Example 1
9.1.2.1.2. Example 2
9.1.3. The optparse Module — Parse Command-Line Options
9.1.3.1. Example
9.1.4. The platform Module — Get Platform Information
9.1.4.1. Example
9.1.5. The getpass Module — Generate and Check Passwords
9.1.5.1. Example
9.1.6. Some Other Things You Can Do
9.2. Accessing Windows Services
9.2.1. The winreg Module — Manipulate the Windows Registry
9.2.1.1. Example
9.2.2. The winsound Module
9.2.2.1. Example
9.2.3. The win32serviceutil Module — Manage Windows Services
9.2.3.1. Example
9.2.4. The win32net Module — Access Windows Networking Features
9.2.4.1. Example
9.2.5. Some Other Things You Can Do
9.3. Accessing Unix/Linux Services
9.3.1. The termios Module — Access Unix-Style TTY Interface
9.3.1.1. Example
9.3.2. The resource Module — Manage Unix System Resources
9.3.2.1. Example
9.3.3. The syslog Module — Access the Unix syslog
9.3.3.1. Example
9.3.4. The commands Module — Run Commands and Get Output
9.3.4.1. Example
9.3.5. Some Other Things You Can Do
9.4. Summary
10. Debugging and Testing
10.1. The Python Debugger
10.1.1. Running the Debugger
10.1.1.1. Importing the pdb Module Directly
10.1.1.2. Accessing the Python Debugger through IDLE
10.1.1.3. The Debug Control window
10.1.1.4. Example
10.2. Python Test Frameworks
10.2.1. Why We Test
10.2.2. Unit Testing
10.2.2.1. Manual Unit Testing with the Python Interactive Interpreter
10.2.2.2. unittest — Python's Default Unit Test Framework
10.2.2.2.1. Example
10.2.2.2.2. Running the Tests
10.2.2.3. doctest — a Compelling Alternative
10.2.2.3.1. Example 1
10.2.2.3.2. Example 2
10.3. Summary
10.4. Final Remarks
A. Where to Go From Here — Resources That Can Help
A.1. Books
A.2. Websites and Blogs
B. Installing Supplemental Programs
B.1. Installing MySQL
B.1.1. Downloading the MySQL Community Server
B.1.2. Running the Install
B.1.3. Configuring the MySQL Server
B.2. Installing Win32All
B.2.1. Downloading the Win32All Package
B.2.2. Running the Install
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
8. Content Management System
Next
Next Chapter
9. Interacting with the Operating System
Part II. Advanced Topics
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset