计算机书籍控

Python编程(上下)(影印版)(第4版)

   《Python编程(影印版)(第4版)(套装共2册)》针对该语言的主要应用领域——系统管理、GUI和Web——做了深入讲解,并且探索了它在数据库、网络、前端脚本撰写层、文本处理和更多方面的使用。通过重点关注常用工具和库,你将会对Python在实际现实世界里的编程有更深的理解。你将通过一种清晰和简洁的方式——讲解大量正确用法和常见惯例的例子——学会语言的语法和编程技巧。《Python编程(影印版)(第4版)(套装共2册)》针对3.x版本做了完全的更新,它探讨了Python如何成为软件开发工具,并且特别为此设计了很多代码示例。

目录


Preface
Part Ⅰ.The Beginning
1.A Sneak Preview
“Programming Python: The Short Story”
The Task
Step 1: Representing Records
Using Lists
Using Dictionaries
Step 2: Storing Records Persistently
Using Formatted Files
Using Pickle Files
Using Per-Record Pickle Files
Using Shelves
Step 3: Stepping Up to OOP
Using Classes
Adding Behavior
Adding Inheritance
Refactoring Code
Adding Persistence
Other Database Options
Step 4: Adding Console Interaction
A Console Shelve Interface
Step 5: Adding a GUI
GUI Basics
Using OOP for GUIs
Getting Input from a User
A GUI Shelve Interface
Step 6: Adding a Web Interface
CGI Basics
Running a Web Server
Using Query Strings and urllib
Formatting Reply Text
A Web-Based Shelve Interface
The End of the Demo
Part Ⅱ.System Programming
2.System Tools
“The os.path to Knowledge”
Why Python Here?
The Next Five Chapters
System Scripting Overview
Python System Modules
Module Documentation Sources
Paging Documentation Strings
A Custom Paging Script
String Method Basics
Other String Concepts in Python 3.X: Unicode and bytes
File Operation Basics
Using P'rograms in Two Ways
Python Library Manuals
Commercially Published References
Inrroducing the sys Module
Platforms and Versions
The Module Search Path
The Loaded Modules Table
Exception Details
Other sys Module Exports
Introducing the os Module
Tools in the os Module
Administrative Tools
Portability Constants
Common os.path Tools
Running Shell Commands from Scripts
Other os Module Exports
3.Script Execution Context
“I’d Like to Have an Argument, Please”
Current Working Directory
CWD, Files, and Import Paths
CWD and Command Lines
Thread Exits and Shared State
Interprocess Communication
Anonymous Pipes
Named Pipes (Fifos)
Sockets: A First Look
Signals
The multiprocessing Module
Why multiprocessing?
The Basics: Processes and Locks
IPC Tools: Pipes, Shared Memory, and Queues
Starting Independent Programs
And Much More
Why multiprocessing? The Conclusion
Other Ways to Start Programs
The os.spawn Calls
The os.startfile call on Windows
A Portable Program-Launch Framework
Other System Tools Coverage
Command-Line Arguments
Parsing Command-Line Arguments
Shell Environment Variables
Fetching Shell Variables
Changing Shell Variables
Shell Variable Fine Points: Parents, putenv, and getenv
Standard Streams
Redirecting Streams to Files and Programs
Redirected Streams and User Interaction
Redirecting Streams to Python Objects
The io.StringIO and io.Bytesl0 Utility Classes
Capturing the stderr Stream
Redirection Syntax in Print Calls
Other Redirection Options: os.popen and subprocess Revisited
4.File and Directory Tools
“Erase Your Hard Drive in Five Easy Steps!”
File Tools
The File Object Model in Python 3,X
Using Built-in File Objects
Binary and Text Files
Lower-Level File Tools in the os Module
File Scanners
Directory Tools
Walking One Directory
Walking Directory Trees
Handling Unicode Filenames in 3.X: listdir, walk, glob
5.Parallel System Tools
“Telling the Monkeys What to Do”
Forking Processes
The fork/exec Combination
Threads
The _thread Module
The threading Module
The queue Module
Preview: GUIs and Threads
More on the Globallnterpreter Lock
Program Exits
sys Module Exits
os Module Exits
Shell Command Exit Status Codes
Process Exit Status and Shared State
Thread Exits and Shared State
Interprocess Communication
Anonymous Pipes
Named Pipes (Fifos)
Sockets: A First Look
Signals
The multiprocessing Module
Why multiprocessing?
The Basics: Processes and Locks
IPC Tools: Pipes, Shared Memory, and Queues
Starting Independent Programs
And Much More
Why multiprocessing? The Conclusion
Other Ways to Start Programs
The os.spawn Calls
The os.startfile call on Windows
A Portable Program-Launch Framework
Other System Tools Coverage
6.Complete System Programs
“The Greps of Wrath”
A Quick Game of “Find the Biggest Python File”
Scanning the Standard Library Directory
Scanning the Standard Library Tree
Scanning the Module Search Path
Scanning the Entire Machine
Printing Unicode Filenames
Splitting and Joining Files
Splitting Files Portably
Joining Files Portably
Usage Variations
Generating Redirection Web Pages
Page Template File
Page Generator Script
A Regression Test Script
Running the Test Driver
Copying Directory Trees
Comparing Directory Trees
Finding Directory Differences
Finding Tree Differences
Running the Script
Verifying Backups
Reporting Differences and Other Ideas
Searching Directory Trees
Greps and Globs and Finds
Rolling Your Own find Module
Cleaning Up Bytecode Files
A Python Tree Searcher
Visitor: Walking Direcror/es “++”
Editing Files in Directory Trees (Visitor)
Global Replacements in Directory Trees (Visitor)
Counting Source Code Lines (Visitor)
Recoding Copies with Classes (Visitor)
Other Visitor Examples (External)
Playing Media Files
The Python webbrowser Module
The Python mimetypes Module
Running the Script
Automated Program Launchers (External)
……
Part Ⅲ.GUI Programming
Part Ⅳ.Internet Programming
Part Ⅴ.Tools and Techniques
Part Ⅵ.The End
Index

书籍下载

尊重版权,请购买正版书籍

正版书籍

Python编程(上下)(影印版)(第4版)