Beginning Python - From Novice to Professional
Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional
■INDEX 577 assertEqual method TestCase class 348 AssertionError class 566 assertNotAlmostEqual method TestCase class 348 assertNotEqual method TestCase class 348 assertRaises method TestCase class 348 assignment statements 13, 83, 566 = operator 547 augmented assignment statements 84, 85, 566 chained assignments 84 changing lists 41 sequence unpacking 83–84 slice assignments 42 asterisk width specifier 58 async_chat class asynchat module 460 collect_incoming_data method 460–461 found_terminator method 460–461 handle_close method 461 push method 461 set_terminator method 460–461 asynchat module 302, 455–456 async_chat class 460 multiple connections 304 asynchronous I/O multiple connections 304 select and poll functions 306 asyncore framework 456 asyncore module 302, 455–456 dispatcher class 457 loop method 458 multiple connections 304 AttributeError class 161, 170 attributes, binding to functions 149 augmented assignments 84–85, 566 ■B backticks (` `) 551 converting a Python value to a string 25–26 BaseRequestHandler class 303 bdist command 377 Beautiful Soup module 319–320 Beck, Kent et al Refactoring 387 Test-Driven Development 387 binary mode mode argument, open function 257 bind method dispatcher class 458 socket class 298 blit method pygame.display module 529 transfering contents of one surface to another 529 blocking 298 blocks, indentation 85–86, 547 blocks generator instant markup project 394 body method NNTP class 441, 442 bool function 559 Boole, George 86 Boolean statements 91–92 Boolean values 86 break statements, 98, 568 else clauses 167 build command 374 built-in functions 16–17, 559 built-in methods issubclass method 153 bulletin board project 483 first implementation 486–489 further exploration 498 goals 483–484 preparations 484–485
578 ■INDEX problem 483 second implementation 489–490 edit.cgi 493–494 main.cgi 490, 492 save.cgi 494 testing 496 view.cgi 492–493 tools 484 ■C callable function 559 callback method adding to handler superclass 398 callproc() method cursor objects 289 Canvas class line method 413 pdfgen module 413 catching exceptions 162 CGI (Common Gateway Interface) CGI security risks 323 debugging with cgitb 324 dynamic web pages 321 adding the Pound Bang line 321–322 preparing the Web server 321 setting file permissions 322 invoking CGI scripts without forms 326 remote editing with CGI 473–481 simple CGI script 323–324 simple form 327–328 using cgi module 325–326 cgi module 302, 321, 330, 474 using 325–326 cgitb module 330 debugging with 324, 474 enable function 324 tracebacks 486 chained assignments 84 chained comparison operators 89 character sets 237 ChatRoom class commands implemented 466 ChatServer class 457–459 ChatSession class 459–463 enter method 466 checkIndex function 182 choice() function random module 228 chr function 559 class keyword defining classes 550 class methods creating with staticmethod and classmethod types 187 classes and types 147–148 attributes, functions and methods 149 creating 148 defining classes 550 definitions 570 interfaces 155–156 methods 150–151 multiple superclasses 154–155 namespaces 151–152 subclassing built-in classes 173 superclasses 153 clear method dictionaries 72–73 close function fileinput module 219 close method connection object 288, 486 cursor objects 289 file object 261 Shelve class 231 cmath module 18 Cmd class cmd module 509 command interpretation, modeling 463–464
- Page 558 and 559: CHAPTER 29 ■ ■ ■ Project 10:
- Page 560 and 561: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 562 and 563: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 564 and 565: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 566 and 567: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 568 and 569: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 570 and 571: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 572 and 573: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 574 and 575: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 576 and 577: CHAPTER 29 ■ PROJECT 10: DO-IT-YO
- Page 578 and 579: APPENDIX A ■ ■ ■ The Short Ve
- 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 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 630 and 631: ■INDEX 599 split function re modu
- 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
578 ■INDEX<br />
problem 483<br />
second implementation 489–490<br />
edit.cgi 493–494<br />
main.cgi 490, 492<br />
save.cgi 494<br />
testing 496<br />
view.cgi 492–493<br />
<strong>to</strong>ols 484<br />
■C<br />
callable function 559<br />
callback method<br />
adding <strong>to</strong> handler superclass 398<br />
callproc() method<br />
cursor objects 289<br />
Canvas class<br />
line method 413<br />
pdfgen module 413<br />
catching exceptions 162<br />
CGI (Common Gateway Interface)<br />
CGI security risks 323<br />
debugging with cgitb 324<br />
dynamic web pages 321<br />
adding the Pound Bang line 321–322<br />
preparing the Web server 321<br />
setting file permissions 322<br />
invoking CGI scripts without forms 326<br />
remote editing with CGI 473–481<br />
simple CGI script 323–324<br />
simple form 327–328<br />
using cgi module 325–326<br />
cgi module 302, 321, 330, 474<br />
using 325–326<br />
cgitb module 330<br />
debugging with 324, 474<br />
enable function 324<br />
tracebacks 486<br />
chained assignments 84<br />
chained comparison opera<strong>to</strong>rs 89<br />
character sets 237<br />
ChatRoom class<br />
commands implemented 466<br />
ChatServer class 457–459<br />
ChatSession class 459–463<br />
enter method 466<br />
checkIndex function 182<br />
choice() function<br />
random module 228<br />
chr function 559<br />
class keyword<br />
defining classes 550<br />
class methods<br />
creating with staticmethod and<br />
classmethod types 187<br />
classes<br />
and types 147–148<br />
attributes, functions and methods 149<br />
creating 148<br />
defining classes 550<br />
definitions 570<br />
interfaces 155–156<br />
methods 150–151<br />
multiple superclasses 154–155<br />
namespaces 151–152<br />
subclassing built-in classes 173<br />
superclasses 153<br />
clear method<br />
dictionaries 72–73<br />
close function<br />
fileinput module 219<br />
close method<br />
connection object 288, 486<br />
cursor objects 289<br />
file object 261<br />
Shelve class 231<br />
cmath module 18<br />
Cmd class<br />
cmd module 509<br />
command interpretation, modeling<br />
463–464