12.07.2015 Views

Is Python a

Is Python a

Is Python a

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Part I - Modules, 646Part I - Programs, 646Part I - Scripts, 647Part II - Dictionary indexing, 651Part II - Dictionary keys, 651Part II - Files, 653Part II - Generic operations, 652Part II - Immutable types, 653Part II - Indexing and slicing, 650Part II - Indexing, slicing, and del, 650Part II - Nesting, 653Part II - String indexing, 652Part II - The basics, 648Part II - The dir function revisited, 653Part II - Tuple assignment, 651Part III - Backslash characters, 654Part III - Coding basic loops, 654Part III - Program logicalternatives, 655Part III - Sorting dictionaries, 654Part IV - Arguments, 656Part IV - file dicts.py, 658Part IV - Keywords, 657Part IV - List comprehensions, 660Part IV - More argument-matchingexamples, 659Part IV - Primes revisited, 659Part IV - The basics, 656Part IV - varargs, 657Part V - _ _main_ _, 662Part V - Circular imports, 664Part V - from/from *, 662Part V - Import basics, 661Part V - Nested imports, 662Part V - Package imports, 663Part V - Reloads, 664Part VI - Class tree links, 670Part VI - Composition, 670Part VI - Inheritance, 664Part VI - Metaclass methods, 667Part VI - Operator overloading, 666Part VI - Set objects, 668Part VI - Subclassing, 667Part VI - The Dead Parrot Sketch, 672Part VI - Zoo animal hierarchy, 671Part VII - Error handling, 673Part VII - Exception objects andlists, 673Part VII - try/except, 672_ _exit_ _ method, 600expression operators, 95, 96–98mixed operators, 97overloading, 98parentheses group subexpressions, 97expression statements, 228–229common, 228in-place changes, 229expression-based equivalents, 347expressions operatorsmixed types, 97numbers, 99parentheses, 97extending, <strong>Python</strong> with C, 15Extensible Markup Language, 10extension modules, 399extensions, 7, 630byte code, 25compiled, 630Ffactories, 532–533why use, 533factory function, 321False built-in name, 109FIFO files, 182fifos, 86file extensions, 40file scanners, 259files, 67, 85–86, 176–182access-by-key, 182calling the file close method, 178changing file position to offset N for nextoperation, 177common operations, 176creating input file, 176creating output file, 176descriptor, 182executing, 24flushing output buffer to disk withoutclosing, 177generating namespaces, 405–406in action, 178–182storing and parsing objects, 178storing and parsing packed binarydata, 181storing native <strong>Python</strong> objects withpickle, 180writing single line of text as astring, 178Index | 687

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

Saved successfully!

Ooh no, something went wrong!