Generate Grid.py

e (constant) (math module), 60 editor (IDLE), 13-14, 364, 424-425 element trees; see xml.etree package elif (statement); see if statement else (statement);see for loop, if statement, and while loop email module, 226 encode() (str type), 73, 92, 93, 296,

336,419, 441 encoding attribute (file object), 325 encoding errors, 167 encodings, 91-94 encodings, XML, 314 end() (match object), 507 END constant (tkinter module), 583,

587, 588 endianness, 297

endpos attribute (match object), 507 endswith()

bytearray type, 299 bytes type, 299 str type, 73, 75, 76 __enter__() , 369, 371, 372 entities, HTML, 504 Entry type (tkinter module), 591 enumerated (built-in), 139-141, 398, 524

enums; see namedtuple type environ mapping (os module), 223

environment variable LANG, 87 PATH, 12, 13

PYTHONDONTWRITEBYTECODE, 199 PYTHONOPTIMIZE, 185,199, 359, 362

PYTHONPATH, 197,205 EnvironmentError (exception), 167 EOFError (exception), 100 epsilon; see sys.float_info.epsilon attribute

259, 379

error handling; see exception handling error-handling policy, 208 escape()

re module, 502

xml.sax.saxutils module, 186, 226, 320

escapes, HTML and XML, 186, 316 escapes, string, 66, 67 escaping, newlines, 67 eval() (built-in),242,243, 258, 266,

275, 344, 349, 379 event bindings, 576 event loop, 572, 578, 590 example

Abstract.py, 386 bigdigits.py, 39-42 BikeStock.py, 332-336 BinaryRecordFile.py, 324-332 blocks.py, 525-534, 543-547,

559-562 bookmarks-tk.pyw, 578-593 car_registration_server.py, 464-471 car_registration.py, 458-464 CharGrid.py, 207-212 checktags.py, 169 convert-incidents.py, 289-323 csv2html.py, 97-102 csv2html2_opt.py, 215 digit_names.py, 180 dvds-dbm.py, 476-479

example (cont.)

dvds-sql.py, 480-487 external_sites.py, 132 ExternalStorage.py, 375 finddup.py, 224 findduplicates-t.py, 449-453 first-order-logic.py, 548-553, 562-566 FuzzyBool.py, 249-255 FuzzyBoolAlt.py, 256-261 generate_grid.py, 42-44 generate_test_names1.py, 142 generate_test_names2.py, 143 generate_usernames.py, 149-152 grepword-m.py, 448 grepword-p.py, 440-442 grepword.py, 139 grepword-t.py, 446-448 html2text.py, 503 Image.py, 261-269 IndentedList.py, 352-356 interest-tk.pyw, 572-578 magic-numbers.py, 346-351 make_html_skeleton.py, 185-191 noblanks.py, 166 playlists.py, 519-525, 539-543,

555-559 print_unicode.py, 88-91 Property.py, 376 quadratic.py, 94-96 Shape.py, 238-245 ShapeAlt.py, 246-248 SortedDict.py, 276-283 SortedList.py, 270-275 SortKey.py, 368 statistics.py, 152-156 TextFilter.py, 385 TextUtil.py, 202-207 uniquewordsl.py, 130 uniquewords2.py, 136 untar.py, 221 Valid.py, 407-409 XmlShadow.py, 373 except (statement);see try statement exception

AssertionError, 184 AttributeError, 240, 241,275,

350, 364, 366 custom, 168-171, 208 EnvironmentError, 167 EOFError, 100

Exception, 164, 165, 360,418 ImportError, 198,221,350 IndexError, 69,211, 273 IOError, 167

KeyboardInterrupt, 190, 418, 442 KeyError, 135, 164, 279 LookupError, 164 NameError, 116

NotImplementedError, 258, 381,

385 OSError, 167 StopIteration, 138,279 SyntaxError, 54, 348, 414-415 TypeError, 57, 135,138,146, 167, 173,179,197,242,258,259,274, 364, 380 UnicodeDecodeError, 167 UnicodeEncodeError, 93 ValueError, 57,272, 279 ZeroDivisionError, 165,416 Exception (exception), 164,165, 360 exception handling, 163-171, 312

see also try statement exceptions, chaining, 419-420 exceptions, custom, 168-171,208 exceptions, propagating, 370 exec() (built-in), 260, 345-346, 348, 349, 351

executable attribute (sys module), 441

execute() (cursor object), 481,482,

483, 484, 485,486,487 executemany() (cursor object), 482 exists() (os.path module), 224, 327, 481

exit() (sys module), 141,215 exp() (math module), 60

expand() (match object), 507 expandtabs()

bytearray type, 299 bytes type, 299 strtype, 73 expat XML parser, 315, 317, 318 expression, conditional, 160, 176, 189

expressions, Boolean, 54 extend()

bytearray type, 299, 301,462 list type,115, 116 extending lists, 114 extension .bz2, 219 .csv, 220 .gz, 219,228 .ini, 220, 519 .m3u, 522, 541, 557 .pls, 519, 539, 555 .py, 9,195, 571 .pyc and .pyo, 199 .pyw, 9, 571 .svg, 525

.tar, .tar.gz, .tar.bz2,219, 221 .tgz, 219,221 .wav, 219 .xpm, 268 .zip, 219 external_sites.py (example), 132 ExternalStorage.py (example), 375

Was this article helpful?

0 0

Post a comment