Beginning Python - From Novice to Professional
Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional
■INDEX 599 split function re module 239, 240 Sprite class pygame.sprite module 530 sqrt function 18 math module 554 Stackless Python alternative Python distribution 6 StandardError exception class 287 start method adding to handler superclass 398 Match Objects 242 start_paragraph method adding to handler superclass 398 statements 14–15 assignment statements 83–85 blocks 85–86 conditional statements 86–87 elif clauses 88 else clauses 87 if statements 87 nesting blocks 88 conditions 86 assertions 93 boolean statements 91–92 comparison operators 89–91 del statements 103–104 eval statements 105–106 exec statements 104–105 if statements 16 import statements 82–83 loops 93–94 breaking out of 98–100 for loops 95 iterating over dictionaries 96 iteration utilities 96–98 while loops 94 pass statements 102 print statements 14, 16 using with commas 81–82 static methods creating with staticmethod objects 187 stderr variable sys module 215, 258 stdin variable iteratorability of 266 sys module 215, 258 stdout class sys module 215, 258 write method 310 StopIteration exception 190 str function 25, 561 StreamRequestHandler class 303 strftime function time module 227, 441 string formatting dictionaries 71, 72 string module 501 Template class 72 template strings 54 values from 60 string representations 25 strings comparing strings and sequences 91 concatenating strings 24 input compared to raw_input 26 long strings 27 methods 563–565 raw strings 27, 28 single-quoted strings and escaping quotes 23–24 string formatting 53–56 conversion types 56–57 signs, alignment, and zero-padding 58–59 simple conversion 56 width and precision 57
600 ■INDEX string methods 59–60 find method 60–61 join method 61–62 lower method 62 replace method 62 split method 63 strip method 63 translate method 64–65 string representations 25 Unicode strings 29 strip method 63 strptime function time module 227 sub method adding to handler superclass 398 sub function re module 239, 240 subclassing built-in classes 173 list, dict, and str 182–184 subprocess module running the Tidy program 317 using command-line tools 352 subprocess module speeding up programs 361 substitutions using group numbers and functions in 242–243 sum function 561 sunspots example creating line diagram from data 411 first implementation 413 constructing some polylines 415 drawing with ReportLab 413–414 prototype 416 preparations 412 second implementation 417 getting the data 417–418 using LinePlot class 418 super function using 178–179 working on old style classes 173 superclasses multiples 154–155 specifying 153 Surface function pygame module 528 SWIG tool 361 compiling, linking, and using 364–365 detecting palindromes 362–363 extending Python 358 installing 362 interface file 363 introduction 361 running 363 using 362 synchronous network programming 298 SyntaxError class 161 sys module example 216 functions and variables 215 getdefaultencoding function 436 setdefaultencoding function 436 system function os module 217 ■T TCPServer class SocketServer module 303 telephone book example 70 revised 78 tell method file object 260 telnetlib module 302 Template class string Module 72 template strings 54 Test-Driven Development Beck, Kent et al 387
- Page 580 and 581: APPENDIX A ■ THE SHORT VERSION 54
- Page 582 and 583: APPENDIX A ■ THE SHORT VERSION 55
- Page 584 and 585: APPENDIX A ■ THE SHORT VERSION 55
- Page 586: APPENDIX A ■ THE SHORT VERSION 55
- Page 589 and 590: 558 APPENDIX B ■ PYTHON REFERENCE
- Page 591 and 592: 560 APPENDIX B ■ PYTHON REFERENCE
- Page 593 and 594: 562 APPENDIX B ■ PYTHON REFERENCE
- Page 595 and 596: 564 APPENDIX B ■ PYTHON REFERENCE
- Page 597 and 598: 566 APPENDIX B ■ PYTHON REFERENCE
- Page 599 and 600: 568 APPENDIX B ■ PYTHON REFERENCE
- Page 601 and 602: 570 APPENDIX B ■ PYTHON REFERENCE
- Page 603 and 604: 572 APPENDIX C ■ ONLINE RESOURCES
- Page 606 and 607: Index ■Symbols - operator 558 !=
- Page 608 and 609: ■INDEX 577 assertEqual method Tes
- Page 610 and 611: ■INDEX 579 cmd module 252, 501 Cm
- Page 612 and 613: ■INDEX 581 get method 74-75 has_k
- Page 614 and 615: ■INDEX 583 ■F Factory class twi
- Page 616 and 617: ■INDEX 585 finding conflicts 197
- Page 618 and 619: ■INDEX 587 initialization 38 nami
- Page 620 and 621: ■INDEX 589 localtime function tim
- Page 622 and 623: ■INDEX 591 nesting blocks 88 Netw
- Page 624 and 625: ■INDEX 593 playful programming 38
- Page 626 and 627: ■INDEX 595 Python C API 365 hand-
- Page 628 and 629: ■INDEX 597 ■S safe_substitute m
- Page 632 and 633: ■INDEX 601 TestCase class methods
- Page 634 and 635: ■INDEX 603 further exploration 47
- Page 641: forums.apress.com FOR PROFESSIONALS
■INDEX<br />
599<br />
split function<br />
re module 239, 240<br />
Sprite class<br />
pygame.sprite module 530<br />
sqrt function 18<br />
math module 554<br />
Stackless <strong>Python</strong><br />
alternative <strong>Python</strong> distribution 6<br />
StandardError exception class 287<br />
start method<br />
adding <strong>to</strong> handler superclass 398<br />
Match Objects 242<br />
start_paragraph method<br />
adding <strong>to</strong> handler superclass 398<br />
statements 14–15<br />
assignment statements 83–85<br />
blocks 85–86<br />
conditional statements 86–87<br />
elif clauses 88<br />
else clauses 87<br />
if statements 87<br />
nesting blocks 88<br />
conditions 86<br />
assertions 93<br />
boolean statements 91–92<br />
comparison opera<strong>to</strong>rs 89–91<br />
del statements 103–104<br />
eval statements 105–106<br />
exec statements 104–105<br />
if statements 16<br />
import statements 82–83<br />
loops 93–94<br />
breaking out of 98–100<br />
for loops 95<br />
iterating over dictionaries 96<br />
iteration utilities 96–98<br />
while loops 94<br />
pass statements 102<br />
print statements 14, 16<br />
using with commas 81–82<br />
static methods<br />
creating with staticmethod objects 187<br />
stderr variable<br />
sys module 215, 258<br />
stdin variable<br />
itera<strong>to</strong>rability of 266<br />
sys module 215, 258<br />
stdout class<br />
sys module 215, 258<br />
write method 310<br />
S<strong>to</strong>pIteration exception 190<br />
str function 25, 561<br />
StreamRequestHandler class 303<br />
strftime function<br />
time module 227, 441<br />
string formatting<br />
dictionaries 71, 72<br />
string module 501<br />
Template class 72<br />
template strings 54<br />
values from 60<br />
string representations 25<br />
strings<br />
comparing strings and sequences 91<br />
concatenating strings 24<br />
input compared <strong>to</strong> raw_input 26<br />
long strings 27<br />
methods 563–565<br />
raw strings 27, 28<br />
single-quoted strings and escaping quotes<br />
23–24<br />
string formatting 53–56<br />
conversion types 56–57<br />
signs, alignment, and zero-padding<br />
58–59<br />
simple conversion 56<br />
width and precision 57