مشخصات کتاب
-
Alex Martelli
-
2010
-
انگلیسی
-
4692
-
488
-
0
Python Cookbook, 2nd Edition
Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Processing a String One Character at a Time 7
1.2 Converting Between Characters and Numeric Codes 8
1.3 Testing Whether an Object Is String-like 9
1.4 Aligning Strings 11
1.5 Trimming Space from the Ends of a String 12
1.6 Combining Strings 12
1.7 Reversing a String by Words or Characters 15
1.8 Checking Whether a String Contains a Set of Characters 16
1.9 Simplifying Usage of Strings’ translate Method 20
1.10 Filtering a String for a Set of Characters 22
1.11 Checking Whether a String Is Text or Binary 25
1.12 Controlling Case 26
1.13 Accessing Substrings 28
1.14 Changing the Indentation of a Multiline String 31
1.15 Expanding and Compressing Tabs 32
1.16 Interpolating Variables in a String 35
1.17 Interpolating Variables in a String in Python 2.4 36
1.18 Replacing Multiple Patterns in a Single Pass 38
1.19 Checking a String for Any of Multiple Endings 41
1.20 Handling International Text with Unicode 43
1.21 Converting Between Unicode and Plain Strings 45
1.22 Printing Unicode Characters to Standard Output 48
1.23 Encoding Unicode Data for XML and HTML 49
1.24 Making Some Strings Case-Insensitive 52
1.25 Converting HTML Documents to Text on a Unix Terminal 55
2.1 Reading from a File 62
2.2 Writing to a File 66
2.3 Searching and Replacing Text in a File 67
2.4 Reading a Specific Line from a File 68
2.5 Counting Lines in a File 69
2.6 Processing Every Word in a File 72
2.7 Using Random-Access Input/Output 74
2.8 Updating a Random-Access File 75
2.9 Reading Data from zip Files 77
2.10 Handling a zip File Inside a String 79
2.11 Archiving a Tree of Files into a Compressed tar File 80
2.12 Sending Binary Data to Standard Output Under Windows 82
2.13 Using a C++-like iostream Syntax 83
2.14 Rewinding an Input File to the Beginning 84
2.15 Adapting a File-like Object to a True File Object 87
2.16 Walking Directory Trees 88
2.17 Swapping One File Extension for Another
Throughout a Directory Tree 90
2.18 Finding a File Given a Search Path 91
2.19 Finding Files Given a Search Path and a Pattern 92
2.20 Finding a File on the Python Search Path 93
2.21 Dynamically Changing the Python Search Path 94
2.22 Computing the Relative Path from One Directory to Another 96
2.23 Reading an Unbuffered Character in a Cross-Platform Way 98
2.24 Counting Pages of PDF Documents on Mac OS X 99
2.25 Changing File Attributes on Windows 100
2.26 Extracting Text from OpenOffice.org Documents 101
2.27 Extracting Text from Microsoft Word Documents 102
2.28 File Locking Using a Cross-Platform API 103
2.29 Versioning Filenames 105
2.30 Calculating CRC-64 Cyclic Redundancy Checks 107
3. Time and Money . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.1 Calculating Yesterday and Tomorrow 116
3.2 Finding Last Friday 118
3.3 Calculating Time Periods in a Date Range 120
3.4 Summing Durations of Songs 121
Foundations of Python Network Programming
نویسنده: Brandon Rhodes John Goerzen
زبان: انگلیسی