|
Python: Visual QuickStart Guide
by Chris Fehily |
Description
Python: Visual QuickStart Guide teaches the Python programming language to beginning and intermediate programmers. It covers the core language and libraries for Python 2.1.
Contents
Introduction
1. Getting Started
2. Expressions and Statements
3. Working with Numbers
4. Working with Strings
5. Working with Lists and Tuples
6. Working with Dictionaries
7. Control Flow Statements
8. Functions
9. Modules
10. Files
11. Exceptions
12. Classes
Appendix. Python Resouces
Index
Downloads
To get the scripts used in this book, download the zip file python_vqs1_files.zip and double-click it in Windows XP or later or in Mac OS X to expand it (in Linux or Unix, use the gunzip or unzip command). After expansion, read the file readme.txt for a description of the distribution.
Errata and Updates
Page xviii - In Script i.1, change the line "for j in range(len(heads)):" to "for j in range(flips):".
Page 26 - In Figure 2.1, change the fourth line from "s, 1st" to "s, lst".
Page 33 - Change the final tip to "If expr is a string expression, print expr is equivalent to sys.stdout.write(expr + '\n')".
Page 41 - In Table 2.5, change the description of the not operator to "Returns 0 (zero) if x is true, 1 otherwise."
Page 55 - Change the second sentence to "...shows how many times (y) the base, x, is multiplied by itself.
Page 62 - Change the fourth paragraph from the bottom to "Type round(x,n) to round x to n digits...".
Page 69 - Change the second sentence to "A string is an ordered sequence of...".
Page 77 - Delete the extra right-bracket at the end of the encode() function syntax: s.encode(encoding [,errors]).
Page 81 - Delete the first sentence of the second tip.
Page 122 - Change the caption of Figure 5.6 to "...may be indexed with s[i][j][k]... ".
Page 136 - Change the first operation in the left column of Table 5.1 to s[i] = x.
Page 158 - Delete the second gray arrow in the last line of Figure 6.5.
Page 160 - Change the caption of Figure 6.8 to "...if the key doesn’t exist...".
Page 161 - Change the first sentence to "...containing all of a dictionary’s values."
Page 176 - In Scripts 6.2 and 6.3, change "count = n/2" to "count = int(math.sqrt(n))" and execute the statement import math prior to running the scripts.
Page 185 - Change the Python statement in the caption of Script 7.5 from "x=x+1" to "x=x-1".
Page 189 - Change the caption of Figure 7.14 to "The hex digits are 0...9, A...F, and...".
Page 240 - Delete the extra comma in the apply() function syntax: apply(func[,args[,kwargs]]).
Page 245 - The if statement in the first tip is "if (func(i) or (i and (func is None))):"
Page 248 - Change "cond3" to "condN ".
Page 249 - In Figure 8.36, change the style of the statement "print intersection" to be boldface.
Page 266 - In the next-to-last tip, change "from __future__ import true_division" to "from __future__ import division".
Page 275 - Change the parenthetical remark in first sentence to "(...and each function call, for example)".
Page 284 - Change the exec statement syntax to exec "code" [in globals[,locals]].
Page 289 - Change the second sentence to "If the line is shorter than size, the entire line is returned."
Page 322 - Change the syntax quotes in step 2 of "To pickle an object" to straight quotes.
Page 328 - Change the parenthetical remark in last sentence of the SystemExit description to "(the finally clauses of try statements)".
Page 336 - Change the backslashes in Figure 11.10 to double-backslashes (escape sequences): "E:\\temp\\log.tmp".
Page 342 - Change the last paragraph to "try_block and except_block1, except_block2,..., except_blockN are indented blocks...".
Page 357 - In Table 12.3, the __class__ attribute returns the instance’s class itself, not the name of the class.
Page 369 - Change the quotes in Figure 12.18 to straight quotes.
Page 406 - Change "PYTYHONPATH" to "PYTHONPATH" (two places).
Page 407 - Change "PYTYHONPATH" to "PYTHONPATH" (one place).
