Updated 2000/05/30
Certain spacing errors occur on pages v though xv of the table of contents.
Current:
about the author sxix
about the cover illustratio nxxi
Interactive examples 1 4
Should be:
about the authors xix
about the cover illustration xxi
Interactive examples 14
Page 16 (middle of page):
Change:
occurences = {}
to
occurs = {}
Page 32:
>>> x[8:9]
should have been shown as:
>>> x[8:9] =[]
and:
>>> x[5:7] = [6.0,6.5,7.9]
should be:
>>> x[5:7] = [6.0,6.5,7.0]
Page 33:
>>> x = [1.2.3.4] should be >>> x = [1,2,3,4]
Page 34 top code section:
string split(x) should be: string.split(x)
string replace(x ... should be: string.replace(x ....
regEpr.sub(" ", x) should be: regExpr.sub(" ", x)
and
string translate(x, string.maketrans{'i','o'), '\t')
should be (add period before translate and change "{" to "(" after maketran):
string.translate(x, string.maketrans('i','o'), '\t')
Page 55 (top example):
x.insert(2, "hello", 3) should be: x.insert(2, "hello")
(Second last paragraph, first line):
list[n:n] = [] should be: list[n:n+1] = []
Page 61 (last example):
[['ZERO'], 1] should be: [[0], 1]
Page 66 (wrong bracket at end):
tuple([1, 2, 3, 4]} should be: tuple([1, 2, 3, 4])
Page 67:
x[[0] should be x[0]
Page 68:
x = x[:1] should be: x = x[:-1] x = "Hello" + "World" should be: x = "Hello " + "World"
Page 73 (right bracket ended up after the annotation):
string.atoi('123456', 6 should be: string.atoi('123456', 6)
Page 77, (end of top example):
olleH, should be: ,olleH
Page 80 bottom (wrong bracket types):
print "%{pi}.2f - %{pi}.4f - %(e).2f" % dict
should be:
print "%(pi).2f - %(pi).4f - %(e).2f" % dict
Page 86 :
y = x.copy should be: y = x.copy()
Page 94 (last example, add indent to the line):
>>> x = 1 should be: >>> x = 1
Page 100:
t = { 'FtoK':FtoKelvin, 'CtoK:CtoKelvin }should be (add quote
after CtoK): t = { 'FtoK':FtoKelvin, 'CtoK':CtoKelvin )
and:
t2 = { 'FtoK':lambda, degF: 273.15+(degF-32)*5/9.0,
'CtoK':lambda, degC: 273.15+degC }should be (remove commas
after lambda keywords): t2 = { 'FtoK':lambda degF: 273.15+(degF-32)*5/9.0,
'CtoK':lambda degC: 273.15+degC }
Page 134 (first segment under 13.5):
>> s should be: >> x
Page 135 (second last line):
f= open("outFile.txt",W)
should be:
f= open("outFile.txt",'w')
Page 136 (second line, remove extra quotes at end):
print "A line from the print statement"? should be: print "A line from the print statement"
Page 137 at bottom:
import struct
should be at the same level as the following two lines.
Page 141:
file = open("solecache",w)
should be:
file = open("solecache",'w')
cPickle.dump({}, file)
should be followed by:
file.close()
Page 143 (last line of section 13.8):
The only possible issue is that it would not have the low-level control when you write back to the file.
would be clearer if written as (change "that it" to "that you"):
The only possible issue is that you would not have the low-level control of when you write back to the file.
Page 151:
raise MyEror, "Some information about what went wrong" should be: raise MyError, "Some information about what went wrong"
Page 157 ("y" ended up after the annotation):
python script1.p should be: python script1.py
Page 165 for script4a.py:
import fileinput
should be the first line--not at the end of the beginning comment.
Page 174 (fifth last line, remove period at end):
print 2 * 3.14 * myCircle.radius. should be: print 2 * 3.14 * myCircle.radius
Page 177 (last example):
the line: >>> Circle.pishould follow the line:
>>> Circle.pi = 3.14159
Page 178 (top example):
c.area should be: c.area()
Page 179:
The second c1.pi (the one before the output 3.14159)
should be: c2.pi
Page 183:
The top example segment should be: >>> c = C() >>> c.setP() >>> c.printP() Class P >>> c.printC() Class P >>> c.setC() >>> c.printC() Class C >>> c.printP() Class C
Page 184:
printm.x should be: print m.x
Page 186 (add quote at end):
"(but use SC.siv for assignment) should be: "(but use SC.siv for assignment)"
Chapter 17:
Note that if you want to run the Tkinter examples from within IDLE,
omit the ending "mainloop()" line from them. Leave it in if
you are using the command line or running from the emacs mode. IDLE is
already running under TK and their is a bug/problem with it such that
trying to start this again may cause the whole IDLE process to hang.
Page 212 Figure 18.1:
Both files labelled "constants.pi" in Figure 18.1 should be "constants.py"
Page 217 (second last example):
>>> C1 should be: >>> c1
Page 221:
type(5) == intType should be: type(5) == IntType type(5.0) == intType should be: type(5.0) == IntType
Page 223 (last input line, replace period before D with a comma):
issubclass(e.__class__.D) should be: issubclass(e.__class__, D)
Page 223 next to the annotation "but d is not an instance of class E":
isinstance(e, E)
should be
isinstance(d, E)
Page 225:
def __init(self, red, green, blue): should be: def __init__(self, red, green, blue):
Page 230:
a,b,c,d = x should be: a,b,c,d,e = x
('', '', 'Hello', 'There'
should be:
('', '', 'Hello', 'There')
Page 235 middle of page, third example line:
should be:
r"\the" == "\\the"
Page 239:
After the second line, which is:
>>> pattern = r"the the":
add the line:
>>> regexp = re.compile(pattern)
Page 247 middle of page:
>>> import Pythoncom
should be:
>>> import pythoncom
and:
>>> print Pythoncom.CreateGuid()
should be:
>>> print pythoncom.CreateGuid()
Page 262 top example:
remove one of the duplicate lines:
db = dbEngine.OpenDatabase('C:\\Database\\Recept.mdb')
and the last word before section 22.10.2:
access
should be:
Access
Page 265:
C:\Program Files\Python\win32comext\client\pyscript.py
should be:
C:\Program Files\Python\win32comext\axscript\client\pyscript.py
and:
C:\Program Files\Python\win32comext\client\demos\client\wsh
should be:
C:\Program Files\Python\win32comext\axscript\demos\client\wsh
Page 266 (see code download):
StartMenuPath + "\\Another
shortcut to notepad.lnk")
should be:
StartMenuPath + "\\Another shortcut to notepad.lnk")MyShortcut.TargetPath = should be: MyShortcut.TargetPath = \ MyShortcut.WorkingDirectory = should be: MyShortcut.WorkingDirectory = \ MyShortcut.IconLocation = should be: MyShortcut.IconLocation = \ MyShortcut.TargetPath = should be: MyShortcut.TargetPath = \ MyShortcut.IconLocation = should be: MyShortcut.IconLocation = \
Page 282 (last ine of top example): (2000/04/10)
Pawt.test(HelloWorld()) should be: pawt.test(HelloWorld())
Page 285 (first example):
bi = BigInteger("10" should be: bi = BigInteger("10")
Page 295 in first line in section 24.7.1:
jfk1.2.1
should be:
jdk1.2.1
Page 298 (first line in section 25.1):
principle roles
should be:
principal roles
Page 302 in the line before Figure 25.2:
thetopdoc script
should be:
the topdoc script
Page 312 (remove extra 'P' in Python):
print Href('www.Python.org','PPython HQ')
should be:
print Href('www.Python.org','Python HQ')
Page 314:
Heading(1, 'Blue Sky Realty', style="color: blue;
font-style: italic")
should be:
Heading(1, 'Blue Sky Realty', style="color: blue;"
"font-style: italic")
style1 = "H1, H2, H3, H4, H5, H6 {color:green;
background-color:yellow}"
should be:
style1 = "H1, H2, H3, H4, H5, H6 {color:green;" \
"background-color:yellow}"
Page 318 (see code download):
for item in self.items:
if item in self.selected:
s.append(str(Input(type=self.widgettype, name=self.name,
checked=1)))
else:
s.append(str(Input(type=self.widgettype,
name=self.name)))
s.append(str(item))
s.append(sep)
return string.join(s[:-1], "")
should be:
for item in self.items:
if item in self.selected:
s.append(str(Input(type=self.widgettype,
name=self.name, checked=1)))
else:
s.append(str(Input(type=self.widgettype,
name=self.name)))
s.append(str(item))
s.append(sep)
return string.join(s[:-1], "")
Page 323:
def sayHello(name='World'):
"""Display a greeting"""
return "Hello %s!" % name
should be:
def sayHello(name='World'):
"""Display a greeting"""
return "Hello %s!" % name
Page 343, Third last line of File JobBoard.py:
return time.time() self.expires should be: return time.time() > self.expires
Page 347 (second last paragraph):
Bobo should be: Zope
Page 351:
keyword.dwlist should be: keyword.kwlist import builtin should be: import __builtin__
Page 354 (indent line):
def __init__(self): self.x = 1
should be:
def __init__(self): self.x = 1
Page 364 (fourth entry) insert a "t": (2000/04/10)
list1.exend(list2) should be: list1.extend(list2)
Page 399 (under Symbols):
' (single quoted string delimeter) 46 should be: ' (single quoted string delimiter) 46