Beginning Python - From Novice to Professional
Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional
Index ■Symbols - operator 558 != operator 558 #! character sequence 21 % character conversion specifiers 56 % operator 558 & operator 558 *operator as distribution operator 123, 124 as gathering operator 121 **operator as distribution operator 123, 124 as gathering operator 122 * operator 558 ** operator 558 + operator 558 concatenating sequences 551 .pyw file extension reasons for 280 / operator 558 = operator 547 == operator 547, 558 > operator 558 >= operator 558 >> operator 558 ^ operator 558 __all__ Variable 212 __delattr__ method implementing properties with old-style classes 188 __delitem__ method basic sequence and mapping protocol 180 __dict__ attribute 156 __doc__ attribute 112 __future__ module 19 __getattr__ method implementing properties with old-style classes 188, 189 __getattribute__ method endless loop trap 189 implementing properties with old-style classes 188 __getitem__ method 182 basic sequence and mapping protocol 180 __init__ method 173, 175 __iter__ method 173, 189, 190 __len__ method basic sequence and mapping protocol 180, 182 __setattr__ method 188 __setitem__ method basic sequence and mapping protocol 180 | operator 558 ~ operator 558 ` ` backticks 551 converting a Python value to a string 25–26 ■A abs function 17, 559 abstraction 109, 139 classes and types 147–148 attributes, functions and methods 149 creating 148 inheritance 153–154 575
576 ■INDEX interfaces 155–156 methods 150–151 multiple superclasses 154–155 namespaces 151–152 superclasses 153 functions creating 111 documenting 112 functional programming 133–137 parameters 113–126 Python functions 112–113 objects 139–140 encapsulation 143–146 inheritance 146–147 polymorphism 140–143 recursion 129–130 binary search 131–133 factorial and power 130–131 scoping 126–127 rebinding global variables 127–128 structure 110 uses 109–110 accessor methods 184–185 action attribute tag 476 action method rule objects 400, 401 ActivePython 571 alternative Python distribution 6 add function operator module 142 add method Set class 223 addFilter method Parser class 401, 402 addition operator (+) 37 addRule method Parser class 401, 402 algorithms 9, 10 alignment 58 allow_reuse_address attribute SimpleXMLRPCServer class 509 and operator 92, 558 apilevel module property Python DB API 286 append method lists 43 appendleft method deque type 226 apply function 137, 559 arcade game 527 first implementation 531–535 further exploration 545 goals 528 preparations 530–531 problem 527 second implementation 535–545 tools 528–530 argv variable sys module 215 arithmetic operators 11 arraysize attribute cursor objects 289 Art of Computer Programming, The Knuth, Donald 387 Art of UNIX Programming, The Raymond, Eric S. 387 as clause import statements 83 open functions 83 asctime function time module 227 assert method TestCase class 348 assert statements 93, 566 assertAlmostEqual method TestCase class 348
- Page 555 and 556: 524 CHAPTER 28 ■ PROJECT 9: FILE
- 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 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 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
576 ■INDEX<br />
interfaces 155–156<br />
methods 150–151<br />
multiple superclasses 154–155<br />
namespaces 151–152<br />
superclasses 153<br />
functions<br />
creating 111<br />
documenting 112<br />
functional programming 133–137<br />
parameters 113–126<br />
<strong>Python</strong> functions 112–113<br />
objects 139–140<br />
encapsulation 143–146<br />
inheritance 146–147<br />
polymorphism 140–143<br />
recursion 129–130<br />
binary search 131–133<br />
fac<strong>to</strong>rial and power 130–131<br />
scoping 126–127<br />
rebinding global variables 127–128<br />
structure 110<br />
uses 109–110<br />
accessor methods 184–185<br />
action attribute<br />
tag 476<br />
action method<br />
rule objects 400, 401<br />
Active<strong>Python</strong> 571<br />
alternative <strong>Python</strong> distribution 6<br />
add function<br />
opera<strong>to</strong>r module 142<br />
add method<br />
Set class 223<br />
addFilter method<br />
Parser class 401, 402<br />
addition opera<strong>to</strong>r (+) 37<br />
addRule method<br />
Parser class 401, 402<br />
algorithms 9, 10<br />
alignment 58<br />
allow_reuse_address attribute<br />
SimpleXMLRPCServer class 509<br />
and opera<strong>to</strong>r 92, 558<br />
apilevel module property<br />
<strong>Python</strong> DB API 286<br />
append method<br />
lists 43<br />
appendleft method<br />
deque type 226<br />
apply function 137, 559<br />
arcade game 527<br />
first implementation 531–535<br />
further exploration 545<br />
goals 528<br />
preparations 530–531<br />
problem 527<br />
second implementation 535–545<br />
<strong>to</strong>ols 528–530<br />
argv variable<br />
sys module 215<br />
arithmetic opera<strong>to</strong>rs 11<br />
arraysize attribute<br />
cursor objects 289<br />
Art of Computer Programming, The<br />
Knuth, Donald 387<br />
Art of UNIX Programming, The<br />
Raymond, Eric S. 387<br />
as clause<br />
import statements 83<br />
open functions 83<br />
asctime function<br />
time module 227<br />
assert method<br />
TestCase class 348<br />
assert statements 93, 566<br />
assertAlmostEqual method<br />
TestCase class 348