Cover image for The quick Python book
Title:
The quick Python book
Author:
Harms, Daryl D.
Personal Author:
Publication Information:
Greenwich, CT : Manning, 2000.
Physical Description:
xxi, 422 pages ; 24 cm
Language:
English
ISBN:
9781884777745
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Item Holds
Searching...
QA76.73.P98 H37 2000 Adult Non-Fiction Central Closed Stacks
Searching...

On Order

Summary

Summary

This clear and concise introduction to the Python language is aimed at readers who are already familiar with programming in at least one other language.


Author Notes

Daryl Harms has developed and managed the development of software systems since the mid 1980s. He has a Ph.D. in computer science.
Kenneth McDonald is a Technical Writer at Be, Inc. where he is implementing a C++ automatic documentation system entirely in--of course--Python!


Reviews 1

Library Journal Review

Python is a popular new language for web servers that is much easier to understand than Perl. For new users, this very good book explains basic programming with Python, data structures, Python and Windows, Java, and the computer graphics interface. Recommended for all libraries. (c) Copyright 2010. Library Journals LLC, a wholly owned subsidiary of Media Source, Inc. No redistribution permitted.


Table of Contents

Prefacep. xvii
Special thanksp. xviii
About the authorp. xix
About the cover illustratiop. xxi
Author onlinep. xxii
Part 1 Starting outp. 1
1 About Pythonp. 3
1.1 Why should I use it?p. 3
1.2 A look at languagesp. 4
1.3 A comparison of Python and other languagesp. 6
1.4 What's the catch?p. 10
1.5 Have your language and Python too!p. 11
1.6 Python and open source softwarep. 11
1.7 Summaryp. 12
2 About this bookp. 13
2.1 How to use this bookp. 13
2.2 Learning Python by examplep. 14
2.3 Formatting conventions for code examplesp. 14
2.4 What you will find in this bookp. 17
2.5 Where to find more informationp. 19
2.6 Feedbackp. 20
3 Getting startedp. 21
3.1 Installing Pythonp. 21
3.2 IDLE and the basic interactive modep. 22
3.3 Hello, worldp. 25
3.4 Using IDLE's Python Shell windowp. 25
Part 2 The essentialsp. 27
4 The Quick Python overviewp. 29
4.1 About this chapterp. 29
4.2 Python synopsisp. 30
4.3 Built-in data typesp. 30
4.4 Control flow structuresp. 36
4.5 Module creationp. 38
4.6 Object-oriented programmingp. 40
4.7 Summaryp. 41
5 The absolute basicsp. 42
5.1 Indentation and block-structuringp. 42
5.2 Commentsp. 44
5.3 Variables and assignmentsp. 44
5.4 Expressionsp. 45
5.5 Stringsp. 45
5.6 Numbersp. 46
5.7 The None valuep. 49
5.8 Built-in operatorsp. 50
6 Lists and tuplesp. 51
6.1 Lists are like arraysp. 52
6.2 List indicesp. 52
6.3 Modifying listsp. 54
6.4 Sortingp. 56
6.5 Other common list operationsp. 58
6.6 Nested lists and deep copiesp. 60
6.7 Tuplesp. 63
6.8 Summaryp. 66
7 Stringsp. 67
7.1 Strings as sequences of charactersp. 67
7.2 Basic string operationsp. 68
7.3 Special characters and escape sequencesp. 68
7.4 The 'string' modulep. 70
7.5 Converting from objects to stringsp. 77
7.6 Formatting stringsp. 79
8 Dictionariesp. 82
8.1 What is a dictionary?p. 82
8.2 Other dictionary operationsp. 84
8.3 Word countingp. 86
8.4 What can be used as a key?p. 87
8.5 Sparse matricesp. 87
8.6 Dictionaries as cachesp. 88
8.7 Efficiency of dictionariesp. 89
9 Control flowp. 90
9.1 The while loopp. 90
9.2 The if-elif-else statementp. 91
9.3 The for loopp. 92
9.4 Statements, blocks, and indentationp. 94
9.5 Boolean values and expressionsp. 96
10 Functions and proceduresp. 99
10.1 Basic function and procedure definitionsp. 99
10.2 Assigning functions to variablesp. 100
10.3 Lambda expressionsp. 100
10.4 Function parameter optionsp. 101
10.5 Mutable objects as argumentsp. 104
10.6 Local and global variablesp. 104
10.7 Summaryp. 105
11 Modules and scoping rulesp. 106
11.1 What is a module?p. 106
11.2 A first modulep. 107
11.3 The import statementp. 109
11.4 The module search pathp. 110
11.5 Private names in modulesp. 112
11.6 Library and third-party modulesp. 113
11.7 Python scoping rules and namespacesp. 114
12 Using the filesystemp. 120
12.1 Paths and pathnamesp. 120
12.2 Getting information about filesp. 127
12.3 More filesystem operationsp. 128
12.4 Processing all files in a directory subtreep. 129
12.5 Summaryp. 130
13 Reading and writing filesp. 131
13.1 Opening files and file objectsp. 131
13.2 Closing filesp. 132
13.3 Opening files in write or other modesp. 132
13.4 Functions to read and write text or binary datap. 133
13.5 Screen input/output and redirectionp. 134
13.6 The struct modulep. 137
13.7 Pickling objects into filesp. 138
13.8 Shelving objectsp. 141
13.9 Summaryp. 143
14 Exceptionsp. 144
14.1 Introduction to exceptionsp. 144
14.2 Exceptions in Pythonp. 148
15 Scriptsp. 156
15.1 Creating a very basic scriptp. 157
15.2 Making a script directly executable on UNIXp. 161
15.3 Script execution options in Windowsp. 161
15.4 Scripts on Windows versus scripts on UNIXp. 165
15.5 Scripts and modulesp. 167
15.6 Creating executable programs with freezep. 171
15.7 Summaryp. 171
16 Classes and object-oriented programmingp. 173
16.1 Defining classesp. 174
16.2 Instance variablesp. 175
16.3 Methodsp. 175
16.4 Class variablesp. 177
16.5 Class methodsp. 179
16.6 Inheritancep. 180
16.7 Inheritance with class and instance variablesp. 182
16.8 Private variables and private methodsp. 184
16.9 Scoping rules and namespaces for class instancesp. 185
16.10 Destructors and memory managementp. 189
16.11 Multiple inheritancep. 192
16.12 Summaryp. 193
17 Graphical User Interfaces and Tkp. 194
17.1 Installing Tkp. 195
17.2 Starting Tk and using Tkinterp. 195
17.3 Principles of Tkp. 196
17.4 A simple Tkinter applicationp. 198
17.5 Creating widgetsp. 200
17.6 Widget placementp. 201
17.7 What else can Tkinter do?p. 203
17.8 Alternatives to Tk and Tkinterp. 206
17.9 Summaryp. 206
Part 3 Advanced language featuresp. 209
18 Packagesp. 211
18.1 What is a package?p. 211
18.2 A first examplep. 211
18.3 A concrete examplep. 213
18.4 The _all_ attributep. 216
18.5 Proper use of packagesp. 218
19 Data types as objectsp. 219
19.1 Types are objects, toop. 219
19.2 Using typesp. 220
19.3 The types modulep. 220
19.4 Types and user-defined classesp. 221
20 Special method attributesp. 224
20.1 What is a special method attribute?p. 224
20.2 Making an object behave like a listp. 226
20.3 Sample problem 2p. 229
20.4 When to use special method attributesp. 231
21 Regular expressionsp. 232
21.1 What is a regular expression?p. 232
21.2 Regular expressions with metacharactersp. 233
21.3 Regular expressions and raw stringsp. 234
21.4 Extracting matched text from stringsp. 236
21.5 Substituting text with regular expressionsp. 238
21.6 What else can regular expressions do?p. 239
Part 4 Advanced topics and applicationsp. 241
22 Python, Windows, and COMp. 243
22.1 Introductionp. 243
22.2 How to use Python with COMp. 244
22.3 Installation and setupp. 246
22.4 Anatomy of a Python COM serverp. 246
22.5 Creating and using the server from Visual Basicp. 251
22.6 Passing data in and out of the serverp. 253
22.7 Callbacksp. 257
22.8 Using Excel as a clientp. 258
22.9 Distributed COMp. 261
22.10 Client side COM--automating Officep. 261
22.11 Type librariesp. 263
22.12 Guidelinesp. 264
22.13 Other goodiesp. 265
22.14 Sources of informationp. 267
23 Extending Python with C and C++p. 269
23.1 Using this chapterp. 269
23.2 Compilation detailsp. 270
23.3 A first examplep. 271
23.4 Memory managementp. 275
23.5 Writing extensions in C++p. 278
23.6 Where to go from herep. 278
24 Integration with the Java Virtual Machine: JPythonp. 279
24.1 What is JPython?p. 279
24.2 Prologue: the false hope for a single languagep. 280
24.3 JPython, the killer scripting languagep. 281
24.4 Downloading and installing JPythonp. 283
24.5 Using Java from JPythonp. 285
24.6 Using JPython from Javap. 289
24.7 Compiling JPython classesp. 293
24.8 Using Java and JPython togetherp. 295
24.9 Conclusionp. 296
25 HTML and Python--the HTMLgen packagep. 297
25.1 Uses for HTMLgenp. 298
25.2 How HTMLgen renders objectsp. 304
25.3 Document modelp. 304
25.4 Tablesp. 306
25.5 Listsp. 308
25.6 Framesp. 309
25.7 Imagesp. 310
25.8 Image mapsp. 311
25.9 The [A] tagp. 312
25.10 Call protocolp. 313
25.11 CSS1 supportp. 313
25.12 CGI and formsp. 315
25.13 Auxiliary modulesp. 319
25.14 The futurep. 320
26 Using 'Zope'p. 321
26.1 Introductionp. 321
26.2 Object publishingp. 322
26.3 Advanced Zopep. 332
27 What else can Python do?p. 346
Appendix The Quick Python referencep. 349
Indexp. 399