Beginning Python - From Novice to Professional

Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional

16.01.2014 Views

■INDEX 579 cmd module 252, 501 Cmd class 463–464, 509 cmp function 89, 559 code coverage testing 343 collect_incoming_data method async_chat class 460–461 collections module deque type 225–226 command interpretation, modeling Cmd class 463–464 command prompt running scripts from 20 CommandHandler class creating rooms 464–465 command-line tools using with subprocess module 352 comments 22, 112 commit method connection object 288, 486 Common Gateway Interface. See CGI comp.lang.python Usenet group 573 comp.lang.python.announce Usenet group 573 comparison operators 89 chaining 89 comparing strings and sequences 91 equality operator 89 identity operator (is) 90, 91 membership operator (in) 91 compile function re module 239 complex function 559 compound statements 569 concatenation sequences with plus sign + 551 strings 24 condition method rule objects 400, 401 conditional execution if Statements 87 conditional statements 86–87 elif clauses 88 else clauses 87 if statements 87 nesting blocks 88 conditions 86, 87 assertions 93 boolean statements 91–92 comparison operators 89–91 ConfigParser module 384 configuration 383 configuration files 384–385 extracting constants 383–384 conflict function 197 connect function common parameters 287 connection object methods 288 close method 486 commit method 486 cursor method 486 constructors 174 calling unbound superclass constructor 177–178 creating 174–175 overriding 175–177 super function 178–179 ContentHandler class xml.sax.handler module 425 continue statements 99, 568 conversion specifiers 54 anatomy 56 field width 57–58 precision 57 tuples 55 convert function 292 Cookie module 302

580 ■INDEX cookie-cutter code automating 367–368 cookielib module 302 copy method dictionaries 73, 74 Cormen, Thomas H. et al Introduction to Algorithms 387 count method lists 43 CREATE TABLE command 485 create_socket method dispatcher class 458 ctypes tool speeding up programs 361 cursor function 288 cursor object attributes 289 methods 288 dictfetchall method 487, 488 dictfetchone method 486 execute method 486 fetchall method 486, 488 fetchone method 486 cursor method connection object 288, 486 custom exception classes 162 ■D Dalke, Andrew Sorting Mini-HOWTO 49 data structures 31 sequences 31 database application example 291–292 creating and populating tables 292–293 searching and dealing with results 294–295 database support 285 database application example 291–292 creating and populating tables 292–293 searching and dealing with results 294–295 Python Database API 285 connections and cursors 287–289 exceptions 287 global variables 286 types 289 DatabaseError exception class 287 DataError exception class 287 datetime module 227, 251 deallocating objects 366 Debian Linux installing Python 5 def statements 194, 549 commenting 112 defining functions 549 defining generator-function 194 default arguments 550 parameters 120 del statements 42, 103, 104, 168, 567 delattr function 559 deque type collections module 225–226 description attribute cursor objects 289 Design Patterns Gang of Four 387 dict function 69, 559 dictfetchall() method cursor object 487, 488 dictfetchone() method cursor object 486 dictionaries 67 basic operations 69–70 telephone book example 70–71 creating 549 iterating over 96 methods 72, 562 clear method 72–73 copy method 73–74 fromkeys method 74

■INDEX<br />

579<br />

cmd module 252, 501<br />

Cmd class 463–464, 509<br />

cmp function 89, 559<br />

code coverage<br />

testing 343<br />

collect_incoming_data method<br />

async_chat class 460–461<br />

collections module<br />

deque type 225–226<br />

command interpretation, modeling<br />

Cmd class 463–464<br />

command prompt<br />

running scripts from 20<br />

CommandHandler class<br />

creating rooms 464–465<br />

command-line <strong>to</strong>ols<br />

using with subprocess module 352<br />

comments 22, 112<br />

commit method<br />

connection object 288, 486<br />

Common Gateway Interface. See CGI<br />

comp.lang.python Usenet group 573<br />

comp.lang.python.announce Usenet<br />

group 573<br />

comparison opera<strong>to</strong>rs 89<br />

chaining 89<br />

comparing strings and sequences 91<br />

equality opera<strong>to</strong>r 89<br />

identity opera<strong>to</strong>r (is) 90, 91<br />

membership opera<strong>to</strong>r (in) 91<br />

compile function<br />

re module 239<br />

complex function 559<br />

compound statements 569<br />

concatenation<br />

sequences with plus sign + 551<br />

strings 24<br />

condition method<br />

rule objects 400, 401<br />

conditional execution<br />

if Statements 87<br />

conditional statements 86–87<br />

elif clauses 88<br />

else clauses 87<br />

if statements 87<br />

nesting blocks 88<br />

conditions 86, 87<br />

assertions 93<br />

boolean statements 91–92<br />

comparison opera<strong>to</strong>rs 89–91<br />

ConfigParser module 384<br />

configuration 383<br />

configuration files 384–385<br />

extracting constants 383–384<br />

conflict function 197<br />

connect function<br />

common parameters 287<br />

connection object<br />

methods 288<br />

close method 486<br />

commit method 486<br />

cursor method 486<br />

construc<strong>to</strong>rs 174<br />

calling unbound superclass construc<strong>to</strong>r<br />

177–178<br />

creating 174–175<br />

overriding 175–177<br />

super function 178–179<br />

ContentHandler class<br />

xml.sax.handler module 425<br />

continue statements 99, 568<br />

conversion specifiers 54<br />

ana<strong>to</strong>my 56<br />

field width 57–58<br />

precision 57<br />

tuples 55<br />

convert function 292<br />

Cookie module 302

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!