Beginning Python - From Novice to Professional
Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional
■INDEX 591 nesting blocks 88 Network News Transfer Protocol. See NNTP network programming 297 multiple connections 303 asynchronous I/O 305–308 forking and threading with SocketServers 305 socket module 298–300 SocketServer module 302–303 standard library modules 302 Twisted framework 308 downloading and installing 308 writing a Twisted server 309–311 urllib and urlib2 300 opening remote files 300 retrieving remote files 301 virtual tea party 455–472 newnews method NNTP class 441–442 news project 439 first implementation 441–444 further exploration 452 goals 440 preparations 440–441 problem 439 second implementation 444–452 tools 440 nextfile function fileinput module 219, 220 nextset method cursor objects 289 nlargest function heapq module 225 NNTP (Network News Transfer Protocol) introduction 439 NNTP class methods 441 NNTP server access required to use nntplib 440 nntplib library 439, 440 nntplib module 302 NNTPSource class creating 447 None 38 not in operator 558 not operator 558 NotImplementedError exception class 217 NotSupportedError exception class 287 nsmallest function heapq module 225 Nullsoft Scriptable Install System installing Distutils toolkit 378 numbered iteration 97 enumerate function 97 numbers 10–12 cmath module and complex numbers 18 hexadecimal numbers 13 octal numbers 13 NumPy tool speeding up programs 361 ■O object-oriented design 156–157 objects 139–140 encapsulation 143–145 privacy 145–146 inheritance 146–147 polymorphism 140–142 forms of 142–143 oct function 561 octal numbers 13 Official Python Distribution 571 online reources 571 distributions 571 documentation 572 newsgroups and mailing lists 573 toolkits and modules 572–573
592 ■INDEX open function buffering 257 mode argument 256–257 opening files 255–256 shelve module 231 webbrowser module 218 open functions 83, 561 OperationalError exception class 287 operator module add function 142 optparse module 252 or logical operator 551 or operator 558 OR operator (|) finding union of two sets 222 ord function 561 os module example 217–218 functions and variables 216 urandom function 228 os.path module 501 ■P packages 210–211 packaging programs 373 Distutils toolkit 373 installation 374–376 introduction 373–374 wrapping up 376–378 painting a pretty picture project creating line diagram from sunspots data 411–420 further exploration 420 goals 412 problems 411 tools 412 visualizing data from text file 411 palindromes 362–365 detartrated 369–370 parallel iteration 96–97 zip function 97 parameters changing 114–115 reasons for 115–118 collecting 121–123 distributing 123–124 immutability 118–119 keyword parameters and defaults 119–121 supplying and receiving example 124–126 values 113 paramstyle module property Python DB API 286 parse function xml.sax module 425 Parser class addFilter method 402 addRule method 402 instant markup project 401 methods 401 pass statements 102, 567 password handling sha module 478–479 path variable sys module 215 patterns greedy and nongreedy patterns 243 pdfgen module generating PDFs 413 PDFs, generating with ReportLab 413 peer-to-peer interaction 499 pickle 285 pipe characters (|) 259 PlainDestination class creating 445, 447 platform variable sys module 215
- 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 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 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
592 ■INDEX<br />
open function<br />
buffering 257<br />
mode argument 256–257<br />
opening files 255–256<br />
shelve module 231<br />
webbrowser module 218<br />
open functions 83, 561<br />
OperationalError exception class 287<br />
opera<strong>to</strong>r module<br />
add function 142<br />
optparse module 252<br />
or logical opera<strong>to</strong>r 551<br />
or opera<strong>to</strong>r 558<br />
OR opera<strong>to</strong>r (|)<br />
finding union of two sets 222<br />
ord function 561<br />
os module<br />
example 217–218<br />
functions and variables 216<br />
urandom function 228<br />
os.path module 501<br />
■P<br />
packages 210–211<br />
packaging programs 373<br />
Distutils <strong>to</strong>olkit 373<br />
installation 374–376<br />
introduction 373–374<br />
wrapping up 376–378<br />
painting a pretty picture project<br />
creating line diagram from sunspots data<br />
411–420<br />
further exploration 420<br />
goals 412<br />
problems 411<br />
<strong>to</strong>ols 412<br />
visualizing data from text file 411<br />
palindromes 362–365<br />
detartrated 369–370<br />
parallel iteration 96–97<br />
zip function 97<br />
parameters<br />
changing 114–115<br />
reasons for 115–118<br />
collecting 121–123<br />
distributing 123–124<br />
immutability 118–119<br />
keyword parameters and defaults 119–121<br />
supplying and receiving example 124–126<br />
values 113<br />
paramstyle module property<br />
<strong>Python</strong> DB API 286<br />
parse function<br />
xml.sax module 425<br />
Parser class<br />
addFilter method 402<br />
addRule method 402<br />
instant markup project 401<br />
methods 401<br />
pass statements 102, 567<br />
password handling<br />
sha module 478–479<br />
path variable<br />
sys module 215<br />
patterns<br />
greedy and nongreedy patterns 243<br />
pdfgen module<br />
generating PDFs 413<br />
PDFs, generating with ReportLab 413<br />
peer-<strong>to</strong>-peer interaction 499<br />
pickle 285<br />
pipe characters (|) 259<br />
PlainDestination class<br />
creating 445, 447<br />
platform variable<br />
sys module 215