Programming Python

Third Edition September 2006
ISBN 978-0-596-00925-0
Seiten 1596
EUR58.00, SFR92.90


Weitere Informationen zu diesem Buch

Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |


Index

	
[ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ],

A[ Top ]
Active Scripting, 1169
Active Server Pages, 1174
ActiveState, 1186
ActiveX, 1176
administrative tools
      os module, 106
AF_INET variable, socket module, 723
after method, 561
after_idle tools, 559
animation techniques, 564
anonymous pipes, 209-212
ANTIALIAS filter, PIL, 491
anydbm module, 1199, 1201
      shelve module and, 1207
AnyGui, 370
Apache, 1192
APIs (application programming interfaces)
      embedded-call Python, 1463
      object model, 1169
      ppembed, 1486
            code strings, running with, 1487
            customizable validations, running, 1489
            objects, running, 1486
      Python C
            vs. Jython, 1154
      Python integration, 1406
      Python Interpreter, 1500
      running Python from Java, 1152
      SQL, 1228
App class, 259, 261
append(), 1146
applets
      Grail, 1162
      writing in Jython, 1156
application-level programming, xxi
applications, 10
      hierarchies
            superclasses, 259-265
argument lists, 1418
arguments
      command line, 117-119
ASP (Active Server Pages), 1174
asynchat module, 1190
asyncore module, 1190
attributes
      COM servers and, 1180
      doc, 93
automated program launchers, 265-291

B[ Top ]
background activities, 559
base64 module, 719
BaseHTTPServer module, 1189
BASIC, Python compared to, 1511
behavior, OOP, 50
bidirectional IPC, pipes and, 212-216
BigGui example, 593
binary
      files
            distinguishing from text files, 789
            downloading, 769
            module, 719
      search trees, 1307
            compared to dictionaries, 1322
binary data
      parsing
            struct module, 152
binary data files, 149-150
binary files
      splitting and, 240
BinaryTree class, 1309
binascii module, 719
bind method, 445
binding
      events, 443-448
binding events
      Tkinter, 400
binhex module, 719
BitmapImage object, 478
books, 11
Boost Python system, 1461
borders
      labels, 421
bound methods, 62
      callback handlers, 397
browsers
      Active Scripting support, 1171
      email client
            complexity of, 1123
            forwarding mail, 1098
            performance, 1123
            portability, 1124
            replying to mail, 1098
            retrieving mail, 1080
            root page, 1070
            security protocols, 1088
            selecting mail, 1082
            sending mail, 1073
            utility modules, 1106
            viewing mail, 1090
      examples in book, running on, 966
      HTML, languages embedded in, 1170
      interoperability issues, 1160
      Jython and, 1153, 1160
      Python-based, 1161
      restricted file access, 1051
      server files, displaying on, 1046
      surfing the Internet with, 732
browsing, 732
built-in file objects, 143-152
buttons
      command option, 387
      GUIs, 386-389
      images, 480-483
byte streams
      serialized, 41
bytecode files
      cleanup, 313
bytecodes, precompiling strings to, 1476

C[ Top ]
C
      compared to Python, 7
      integration examples, xxx
C API
      threads and, 201
C modules, 1408
C types, 1408, 1444
      compiling, 1446
      string stacking, 1439
      timing implementations, 1447
      wrapping in classes with SWIG, 1451
C# compiler, 1186
C++
      compared to Python, 7
C/C++
      API
            vs. Jython, 1154
      classes
            embedding Python and, 1483
            using in Python, 1456
      data conversion, 1417
            codes, 1419
      embedding Python in, 1463
            code strings, running, 1467
      exceptions and, 1420
      extensions, 1408
            components, adding, 1409
      extensions modules, C extension SWIG, 1412
      Python modules
            Jython and, 1158
            translating to, 1344
      Python scripts integration, 1154, 1405
calculator, GUI, 1153, 1377
_call_ operator, 390
callable objects, 1465
callback handlers
      binding events and, 445
      button state, 458
      CGI and, 965
      Grail, 1163
      GUI, reloading, 609
      Jython and, 1153
      as object references, 610
      registering, embedding Python code and, 1478
      reload() and, 610
      scheduled callbacks, 559
      Tkinter, 387
            bound methods, 397
            callable class objects, 398
            lambda, 390-397
            user-defined, 389-401
callbacks
      GUIs, 386-389
      queues, 620
callbacks, select() and, 752
Canvas
      events, 539
canvas
      scrolling, 536
canvas widgets, 529
      scrolling, 533
CGI (Common Gateway Interface), 711
      HTML and, 1145
      module, 719
      PYTHONPATH, configuring, 980
      scripts, 962
            as callback handlers, 965
            coding for maintainability, 1029
            converting strings in, 997
            debugging, 998
            email browser, 1063
            HTML and, 965, 966
            HTMLgen and, 1147
            installing, 979
            missing/invalid inputs, checking for, 1027
            Python and, 965
            state information, saving, 1012
            web pages, 977
            web sites, 1064
            Zope, 1130
      user interaction, adding to, 986
      web interface, 70-73
cgi module, 719, 965
      web pages, parsing user input, 989
CGI, scripts, 962
cgi.escape(), 1024
cgi.FieldStorage(), form inputs, mocking up, 1024
cgi.FieldStoreage(), 989
cgi.print_form(), debugging CGI scripts, 999
cgi.text(), debugging CGI scripts, 999
CGIHTTPServer module, 720, 1189
chapter, 571
checkbuttons, 456-460
      callback handlers, 458
      command option, 456
      configuring, 419
      dialogs, 427
      Entry widgets, 448
      Message widgets, 448
      variable option, 456
      variables and, 458
      windows, top-level, 422
checkbuttons, adding to HTML forms, 1001
child processes
      exiting from, 736
      forking servers and, 735
classes
      App, 259, 261
      application-specific tool set, 600
      C/C++
            embedding Python code and, 1483
            ppembed API, 1486
            using in Python, 1456
      CollectVisitor, 325
      components
            attaching, 409
            extending, 411
      container classes
            standalone, 412
      DBM and, 1201
      EditVisitor, 320-323
      FileVisitor, 317
      form layout, for FTP client GUI, 761
      graphs to, 1314
      GUIs
            reusable components and, 408-414
      hierarchy, 256
      mixin, 584-586
      multiple clients, handling with, 744
      of stored objects, changing, 1211
      OOP, 48-49
            alternative, 53
      pickled objects and, 1203
      ReplaceVisitor, 323
      SearchVisitor, 317, 325
      set, 1296
      shelves and, 1210
      stack, 1284
      StreamApp, 259
      subclasses
            protocols, 590
      superclasses
            application hierarchies, 259-265
      widgets, 414
            customizing, 406-408
classes (continued)
      wrappers
            windows, 611
      ZODB, 1221
client function, 755
client/server architecture, 717
      on the Web, 964
clients, 717, 722
      COM, 1176
            using servers from, 1181, 1182, 1184
      connecting to, 724
            closing, 724
            establishing, 724
      email
            command line, 831
            interacting with, 883
            viewing mail, 1091
      multiple, handling, 732
            with classes, 744
            with forking servers, 733
            with multiplexing servers, 747
            with threading servers, 742
      path formats, 1059
      scripts, 766
            CGI, scripts, 962
            email, 808
            files, transferring over Internet, 767
            newsgroups, 862
            web sites, accessing, 866
      sending files to, 1046
      socket calls, 725
      socket programs, running locally, 726
      spawning in parallel, 730
client-side scripting
      PyMailGUI, 876
clipboard
      text and, 524
clipping widgets, 402
clock example, 685-700
close event
      intercepting, 425
code
      HTML, escaping, 1040
            URLs embedded in, 1042
      legacy, migration, 1518
      maintainable, 1029
            sharing objects between web pages, 1030
      readable, 4
      running, 19
      URLs, escaping, 1039
code reuse, 1517
      C extension modules and, 1503
      data structures and, 1280
      form layout class, 761
      GUI calculator, 1384
      PyMailGUI, 876, 912
      web forms, 1034
code strings, embedding Python code and, 1465, 1467
      calling Python objects, 1473
      compiling, 1468
            to bytecodes, 1476
      running
            in dictionaries, 1474
            with results and namespaces, 1471
code structure
      PyMailGUI, 912
CollectVisitor class, 325
color
      dialogs
            user selected, 437
      labels, 420
columns, summing, 1340
COM (Component Object Model), 1175
      clients, 1176
            using servers from, 1181, 1182, 1184
      extensions
            distributed, 1185
      integration with Python, 1501
      servers, 1179
            GUIDs, 1180
combo function, 1319
command line
      arguments, 117-119
      CWD and, 116
      email
            client, 831
            sending from, 817
      examples, xxxiii
      GUIs, 597-605
      Jython, 1152
      web browsers, launching, 280
command-line mode
      splitting files, 239
commands
      shell commands, 109-112
Common Object Request Broker (CORBA), 1501
commonhtml module, 1077
      email, viewing, 1091
      state information in URL parameters, passing, 1086
comparedirs function, 351
comparing directory trees, 349-361
      reporting differences, 359
compilers, 12
compiling
      C extension
            files, 1446
            modules, 1412
      code strings in embedded Python code, 1468
component integration, 17
Component Object Model, 1175
conferences, 12
configuring
      checkbuttons, 419
      email client, 810
      PYTHONPATH, CGI scripts and, 980
      radiobuttons, 419
connections
      client, 724
            closing, 724
            establishing, 724
            reserved ports and, 732
      database, 1230
      server, 794
            closing, 725, 770
            establishing, 725
            opening, 769
            POP, 813
connectivity
      creating, 721
      Internet, Python and, 713
console
      shelve interface, 57-60
constants
      raw strings, 1023
container classes
      standalone, 412
convertEndlines function, 303
converting
      objects to strings, pickled objects and, 1202
      Python objects to/from C datatypes, 1417
            return values, 1418
      strings
            in CGI scripts, 997
cookies, 1014, 1127
CORBA (Common Object Request Broker), 1501
counting source lines, 336-339
cpfile function, 342
cPickle module, 1207
create_filehandler tool, 560
creating
      connectivity, 721
      servers, 1189
            Apache, 1192
            Mailman, 1192
            tools for, 1190
            with Python code, 1189
csh (C shell), 174
ctypes, 1460
cursor
      labels, 421
custom dialogs, 440-443
customization
      OOP, 48
      OOP constructors, 53
customizing, 1286
      by users, Python and, 1517
CWD (current working directory), 114
      command line and, 116
      files and, 114
      import path and, 114
CXX system, 1461
Cygwin
      forking processes, 180

D[ Top ]
Dabo, 370
data conversion, 1417
      codes, 1419
data storage, persistent, 1128
database cursor object, 1230
Database Management, 1208
database object, 1230
databases
      access, 17
      connecting to, 1230
      DBM, 1198
      lists, 26
      Python and, 1228
      server-side, 1018
      SQL, 1227
      tables
            loading, 1243
datatypes
      binary trees, 1307
      C, converting to/from Python objects, 1417
      objects and, 1280
datatypes (continued)
      sets, 1293
            classes, 1296
            functions, 1294
            moving to dictionaries, 1297
            relational algebra, adding to, 1303
      stacks, 1281
            as lists, 1281
            optimizing, 1287
date/time formatting, 825
dbhash module, 1201
DBM (Database Management), 1198
      files, 1199
            compatibility of, 1214
            file operations, 1200
            shelves and, 1208
dbm module, 1201
deadlocks
      FTP and, 718
deadlocks, pipes, 214
debugging
      CGI scripts, 998
deleting
      email, 836, 838
      files, when downloading web sites, 788
demos
      setup, xxxvii
development, 17
DHTML (Dynamic Hypertext Markup Language), 1126
Dialog module, 439-440
dialogs
      color
            user selected, 437
      custom, 440-443
      demo, 431
      modal, 427
            custom, 441
      nonmodal, 428
      printing results, 435
      Quit button, 430
      standard, 428
      tkFileDialog module, 434
_dict_ attribute, 1211
dictionaries, 29-35
      code strings, running in, 1474
      of dictionaries, 33
      iteration, 32
      lists, 31
      nested structures, 32
      sets as, 1297
      uses, 36
diff command, 359
Digital Creations, 1145
dirdiff, 352, 354
directories
      CGI scripts and, 979
      glob module, 161-163
      lists
            joining, 164
            splitting, 164
      os.listdir, 163
      os.popen, 160-161
      trees
            searches, 311-316
            walking, 164-170
      walking, 159-164
directory trees
      comparing, 349-361
            reporting differences, 359
      copying, 339-345
      deleting, 345-349
      file permissions
            fixing, 332-334
      files
            editing, 320-323
            matched, 325-329
      global replacements, 323-324
Dispatch(), 1178
distributed programming, 17
doc attribute, 93
documentation
      modules, 92
      strings, 93-95
      Tkinter, 372-373
domain names, 716
domains, 11
DOS
      filenames, 307-311
            rewriting, 310
      line ends, 294-295
            converting in one file, 295-300
      lines
            converting in one directory, 300-303
            converting in tree, 303-307
      start command, 226
downloads
      reusing, 795-803
dump(), pickled objects and, 1202
Dynamic Hypertext Markup Language (DHTML), 1126

E[ Top ]
EditVisitor class, 320-323
education, 13
email, 808
      client
            command line, 831
            configuration module, 810
            interacting with, 883
            viewing mail, 1091
      composing messages, 826
      deleting, 836, 838
      interactive prompt, 816
      loading, 835, 838, 1083
      mailboxes
            accessing, 821
            encapsulating fetches, 1066
            modules, 719
            unlocking, 813
      Mailman, 1192
      Message object, 827
      modules, 719
            headers, 719
      parsing, 836
      parsing messages, 826
      passwords
            POP page, 1100
      POP message numbers, 908
      reading, 809
      saving, 835, 839
      sending, 817
embedding Python code, 1382, 1463, 1514
      code strings, 1467
            compiling, 1468
            running in dictionaries, 1474
            running with objects, 1473
            running with results and namespaces, 1471
      precompiling strings to bytecode, 1476
      registering callback handler objects, 1478
      using Python classes in C, 1483
            ppembed API, 1486
encapsulation, 257
      inheritance and, 614
      OOP, 48
encrypting
      passwords, 1066
end of file
      Windows, 150-151
end-of-line characters
      CGI scripts and, 980
Entry widget (Tkinter), 448-455
      input forms, 450
      modal dialogs, 452
      programming, 450
      variables, 453
environment settings
      launching without, 267-277
eval()
      input expressions, 1376
      security and, 1273
event-driven programming, 377
events
      binding, 443-448
            Tkinter, 400
      Canvas, 539
examples, xxxi
      command lines, xxxiii
      demos, xxxv
      distribution packages, xxxiv
      filenames, xxxiii
      launchers, xxxiv
      listings
            titles, xxxiii
      running, xxxiv
      tree, xxxiii
      uses, xxxii
      web-based, xxxviii
examples in book
      security, 1116
      server-side scripts
            running, 966
            viewing, 971
exceptions
      C and, 1420
      CGI scripts and, 999
      sockets and, 729
      sys module, 103
exec statement
      input expressions, 1376
      Jython, 1152
      security and, 1273
execfile(), Jython, 1152
executable pseudocode, 5
exits, 201-202
      os module, 202-203
      processes, 205-206
      status codes, 203-205
      threads, 206-208
Extensible Markup Language, 719
extensions, 1514
      C types, 1408, 1444
            compiling, 1446
            string stacking, 1439
            timing implementations, 1447
      C/C++, 1408, 1517
            components, adding, 1409
      C/C++ modules, C extension SWIG, 1412
      Python interface, 1406
      Tkinter, 373-374

F[ Top ]
fastset, 1302
fc command, 359
fcntl module, 92
features listing, 15
fetching
      shell variables, 119-121
fields
      labels, 27
      lists, 25
      names, 27
fifos (see named pipes)
file permissions
      directory trees
            fixing, 332-334
file scanners, 156-159
file tools
      os module, 153-156
File Transfer Protocol, 718
filenames
      CGI scripts and, 979
      DOS, 307-311
            rewriting, 310
      examples, xxxiii
      joining files and, 243
files
      binary
            distinguishing from text files, 789
            downloading, 769
            module, 719
      binary data files, 149-150
      client, uploading to web server, 1053
      CWD and, 114
      DBM, 1199
            compatibility of, 1214
            shelves and, 1208
      deleting, when downloading web sites, 788
      descriptors, 153
      directory trees
            editing in, 320-323
            matched, 325-329
      downloading, 753, 774
            frontend for, adding, 757
      end of file
            Windows, 150-151
      formatted
            persistence and, 35-41
      from web server, displaying on client, 1046
      GDBM, 1201
      header, Python, 1417
      HTML, permissions, 977
      input, 145-146
      joining, 237
            portably, 241-244
            usage, 244-247
      as libraries, 98
      media
            portable player tool, 285-291
      objects
            built-in, 143-152
      open modes, 154
      operations, 97-98
      output files, 143-145
      packing, 254-265
      reading
            file iterators and, 146-148
      reading from, 158
      remote
            deleting, 793
            retrieving, 788
      restricted, accessing on browsers, 1051
      as scripts, 98
      shelve, 1207
      splitting, 237
            portably, 237-240
            usage, 244-247
      storing, 793
      streams
            redirecting to, 125-126
      text
            distinguishing from binary, 789
            uploading, 793
      transferring over Internet, 767
            downloading, 767
            frontend for, 779
            to clients and servers, 1046
            uploading, 776
            using various means, 1062
            with urllib, 771
      unpacking, 254-265
FileVisitor class, 317
      printed list, 319
find module, 170
find.find tool, 305
findFiles function, 307, 309
flat files, 1198
flushes, pipes, 214
fonts
      labels, 420
forked processes
      child programs, 182
forking processes, 176-183
      Cygwin (Windows), 180
forking servers, 733
      child processes, exiting from, 736
      zombies
            killing, 736
            preventing, 738
forks, 176
Form class (HTMLgen), 1147
format
      display
            OOP, 52
      scripts
            persistence, 38
formatted files
      persistence and, 35-41
forms
      web, 964
            adding input devices to, 999
            changing, 1003
            hidden fields in, 1020
            inputs, checking for missing/invalid, 1027
            inputs, mocking up, 1024
            laying out with tables, 994
            reusable, 1034
            selection list on, 1020
            tags, 986
            Zope and, 1135
forward-link web pages
      generating, 247-250
Frame widgets, 401
      attaching widgets, 403
frame-based menus, 504-508
frames
      GUIs, 469-471
      inheritance, 408
FTP (File Transfer Protocol), 767
      deadlock and, 718
      files, transferring over Internet, 767
            downloading, 767
            mirroring web sites, 786
            uploading, 776
            with urllib, 771
ftp object
      quit(), 770
      retrbinary(), 769, 774
      storlines(), 794
ftplib module, 718, 719
function calls
      web browsers, launching, 282
functions
      as published objects, 1134
      C, 1411
            SWIG and, 1423
      comparedirs, 351
      comparison, 1321
      convertEndlines, 303
      cpfile, 342
      findFiles, 307, 309
      initialization, 1417
      method, 1417
      re module, 1349
      redirectedGuiFunc, 605
      redirectedGuiShellCmd, 605
      sets, 1294
            multiple operands, supporting, 1295
      timing, 1290
      unique, 352

G[ Top ]
gadgets
      setup, xxxvii
garbage collection
      reference count management, 1421
gdbm module, 1201
generate(), 1315
geometry managers
      pack
            alternatives to, 543
            columns, spanning, 550
            rows, spanning, 550
            widgets, resizing, 382, 388, 402, 404, 405
get method
      scales, 465
getfile(), FTP, 775
_getitem_ method, 1288
getpass.getpass(), FTP, 770
GIF (Graphics Interchange Format) images, displaying on web pages with HTMLgen, 1149
GIF files
      glob module, 481
GIL (global interpreter lock)
      threads, 184
      threads and, 197-201
Gilligan factor, 1508
glob module, 92, 161-163
glob modules
      GIF files, 481
globally unique identifier (GUID), 1180
globs, 311
gopherlib module, 719
Grail browser, 714, 1161
graphics
      on web pages
            adding, 982
            displaying with HTMLgen, 1149
      PyDraw, 676-685
Graphics Interchange Format, 1149
graphs, 1322
      moving to classes, 1314
      searching, 1312
grep popen *.py, 311
grep utility, 1356
grep.grep, 312
grepping, 294
greps, 311
grid geometry manager
      FTP client frontend, 759
grids, 543
gui1 script, 376
GuiInput class, 605
GuiMaker, 586-597
      BigGui, 593-597
      self-test, 592
GuiMakerFrameMenu, 592
GuiMakerWindowMenu, 591
GuiMixin, 584-586
GuiOutput class, 605, 607
GUIs (graphical user interfaces), 17
      animation techniques, 564
      buttons, 386-389
      calculator, 1153, 1377
      callback handlers, reloading, 609
      callbacks, 386-389
      canvas widgets, 529
      checkbuttons
            adding to HTML forms, 1001
            configuring, 419
            dialogs, 427
            Entry widgets, 448
            Message widgets, 448
            variables and, 458
            windows, top-level, 422
      classes
            reusable components and, 408-414
      command lines, 597-605
      frames and, 469-471
      FTP client frontend, 757
      Grail and, 1161
      grids, 543
      Hello World, 376
      images, 478-483
      inheritance, 406
      Jython, interface automation, 1155
      listboxes, 511
      menus, 499, 593
      non-GUI code, 624-635
      object viewers, 1323
            persistent, 1257
      OOP and, 62
      pipes, 630
      programs
            running, 473-477
      queues and, 616-624
      radiobuttons, 460
            adding to HTML forms, 1001
            configuring, 419
            dialogs, 427
            Entry widgets, 448
            Message widgets, 448
            variables and, 462
            windows, top-level, 422
      running, 379-380
      scrollbars, 511
      ShellGui, 597-605
      shelve interface, 65-70
      sliders, 465
      sockets, 627
      streams to widgets, redirecting, 605
      text, 517
            editing, 522
      threads and, 198, 560, 616-624
      Tkinter, 60
      toolbars, 593
      windows, independent, 472
      windows, pop, 625
GuiStreams example, 605

H[ Top ]
handleClient(), 736
      threading, 743
header files, 1417
Hello World
      GUIs and, 376
hierarchies
      applications
            superclasses, 259-265
high-level languages, 3
history of Python, 8
holmes system, 1342
HTML (Hypertext Markup Language)
      browsing
            email, complexity of, 1123
      CGI scripts and, 966, 977, 1145
            embedding in, 1127
      document templates, Zope and, 1132
      email passwords, 1081
            escaping, 1094
      escaping
            conventions, 1040
            email passwords, 1094
            embedded URLs, 1042
            text, 1024
      file permissions, 977
      forms and, 964
      Grail and, 1162
      hidden input fields, passing state information in, 1092
      HTMLgen and, 1145
      hyperlinks, 973
      JavaScript embedded in, 1170
      library of tools, 1066
      module, 719
      passwords, 1081
      tags, 973, 1054
            forms, 986
            Grail and, 1163
            HTMLgen and, 1145
            tables, 984, 994
      web pages and, 972
HTMLgen, 1145
      GIF images, displaying, 1149
      hyperlinks and, 1146
      PYTHONPATH setting, 1149
HTMLgen module, 1145
htmllib module, 719, 1165
HTTP (Hypertext Transfer Protocol), 866
      CGI scripts and, 978
      cookies, 1014, 1127
      module, 719
      requests, Zope and, 1132
      servers, 964
            CGI scripts and, 980
            Python implementations, 1189
httplib module, 719, 866
hyperlinks
      CGI and
            scripts, 964
            state information, 1012
      encrypted passwords in, 1088
      escaping URLs and, 1043
      HTML and, 973
      HTMLgen and, 1146
      smart links, 1008
      URLs
            embedded in, 976, 988
            syntax, 1007
      Zope and, 1134
Hypertext Markup Language, 719
Hypertext Transfer Protocol, 719

I[ Top ]
IANA (Internet Assigned Numbers Authority), 720
Icon, Python compared to, 1511
icons
      top-level windows, 426
identifiers for machines on Internet, 715
IDLE
      Tkinter and, 374
IETF (Internet Engineering Task Force), 720
image viewer, PyPhoto, 657-668
images
      buttons, 480-483
      displaying
            PIL, 484
      file types supported, 480
      slideshow program, 668-676
      thumbnails
            PIL, 489-498
      Tkinter, 478-483
      types
            PIL, 485-488
IMAP (Internet Message Access Protocol) module, 719
imaplib module, 719
import path
      CWD and, 114
IndexError exception, 1421
inheritance
      encapsulation and, 614
      frames, 408
      GUIs, 406
      OOP, 50-52
initialization function, 1417
input
      users, 64
input files, 145-146
input/output, redirection, 605
installing
      CGI scripts, 979
integration, 5, 1463, 1516
      COM and Python, 1501
      component, 17
      CORBA and Python, 1501
      examples, 1499
      extensions, C/C++ embedding Python code, 1501
      Jython and, 1500
      limitations of, 1520
      vs. optimization, 1502
interactive mode
      splitting files, 239
interactive prompt, email, 816
interfaces, 1155
      load server
            PyMailGUI, 890
      os module, 105
      shelve
            console and, 57-60
            GUI, 65-70
            web-based, 78-86
      web, 70
            CGI, 70-73
            query strings, 76-77
            reply text format, 77
            urllib, 76-77
            web server, 73-76
      windows
            top-level, 611-616
Internet
      addresses, 973
      client/server, 717
      clients, 732
      examples, 712
      files, transferring over, 767
            downloading, 767
            frontend for, 779
            to clients and servers, 1046
            uploading, 776
            various means of, 1062
            with urllib, 771
      identifiers for machines connected to, 715
      machine names, 715
      message formats, 716
      modules, 718
      port numbers, 717
      protocols, 710, 766
            message formats, 716
            modules, 719
            structures, 718
      scripting, 17, 711
      scripting clients, scripts servers, scripts, 962
      servers, 732
      sockets, 710
      TCP/IP, 710
Internet Assigned Numbers Authority (IANA), 720
Internet Engineering Task Force (IETF), 720
Internet Explorer
      HTML
            JavaScript embedded in, 1170
      registering Python with, 1171
Internet Message Access Protocol (IMAP) module, 719
Internet Protocol (IP), 715
Internet Service Provider, 715
IP (Internet Protocol), 715
IP addresses, 715
IPC
      bidirectional, pipes and, 212-216
IPC (Inter-Process Communication), 627, 714
ISPs (Internet Service Providers), 715
      Python-friendly, 982
iteration
      dictionaries, 32
iterators
      reading files, 146-148

J[ Top ]
Java
      applets, 1156
      classes
            accessing with Jython, 1152
            testing with Jython, 1153
      end-user customization, 1153
      libraries, Jython and, 1157
      Python and, 1520
Java virtual machine, 1151
JavaJython, 1150
job growth, 13
joining files, 237
      portably, 241-244
      usage, 244-247
JVM (Java virtual machine)
      Jython and, 1158
      Python scripts executed by, 1151
Jython, 369, 709, 1150, 1152
      API, 1152
      applets, writing, 1156
      browsers and, 1153
      callback handlers, 1153
      command lines, 1152
      compatibility with Python, 1158, 1159
      components, 1151
      integration and, 1500
      interface automations, 1153, 1155
      Java classes
            accessing, 1152
            testing, 1153
      Java libraries and, 1157
      object model, 1152
      performance issues, 1159
      Python-to-Java compiler, 1151
      scripts, compared to Java, 1153
      trade-offs in using, 1157
      vs. Python C API, 1154
Jythonc, 1151

K[ Top ]
keyboard
      input
            stream redirection and, 130-134
keyboard shortcuts, menus, 502
killing top-level windows, 425
kwParsing system, 1358

L[ Top ]
labels
      borders, 421
      color, 420
      cursor, 421
      fields, 27
      font, 420
      layout, 421
      padding, 421
      scales, 466
      size, 420
      state, 421
lambda callback handlers, 390-397
lambda statement, 1321
language-based modules, 17
Launch_*.py, xxxviii
launchBookExamples function, 267
LaunchBrowser.py, xxxviii, 265, 277
Launcher.py, xxxviii, 265, 268
launching
      automated program launchers, 265-291
      programs
            without environment settings, 267-277
      web browsers
            command lines and, 280
            function calls, 282
            portably, 277-284
launching programs, 230
      portable framework, 230-234
      Windows, 225
launchmodes script, 266
libraries
      Java, 1157
      Jython, 1157
      manuals, 99-100
      standard library, 91
linking scales, 468
linking, C extension modules, 1413
      static vs. dynamic binding, 1415
Linux
      C extension modules, 1411
            compiling, 1413
            wrapping environment calls, 1430
      end-of-lines, CGI scripts and, 980
      servers
            killing processes on, 729
            web, finding Python on, 982
      showinfo(), 885
Lisp, Python compared to, 1510
listboxes, 511
      adding to HTML forms, 1001
      programming, 512
listings
      examples, xxxiii
lists, 25-29
      databases, 26
      dictionaries, 31
      fields, 25
      joining, 164
      records, 25
      splitting, 164
      stacks as, 1281
      uses, 30
load server interface
      PyMailGUI, 890
load(), pickled objects and, 1202
loaded modules, 102
loadmail module
      email, viewing, 1091
      POP mail interface, 1107
loadmail.loadmail(), 1083

M[ Top ]
machine names, 715
mailbox module, 719
Mailman program, 1192
mailtools, 839
      initialization file, 840
      MailFetcher class, 845
      MailParser class, 852
      MailSender class, 841
      MailTool class, 841
      self-test script, 856
_main_ module, 1467
mainloop method, 377
mainloop(), 377
      recursive calls, 442
makefile(), sockets and, 758
mapping Tk/Tkinter, 416
marshal module, 1207
matched files, directory trees, 325-329
media files
      portable player tool, 285-291
Medusa, 1190
memory
      threads and, 183
menubutton-based menus, 504-508
menus, 499, 593
      automation, 586-597
      frame-based, 504-508
      GuiMaker class, 593
      keyboard shortcuts, 502
      menubutton-based, 504-508
      separator lines, 501
      tear-offs, 501
      top-level windows, 426, 500-503
message function, 1410
message widget (Tkinter), 448
messages
      error, CGI scripts and, 998
      POP message numbers, 908
      status
            suppressing, 326-329
method functions, 1417
methods
      bind, 445
      bound, 62
            callback handlers, 397
      get, 465
      mainloop, 377
      OOP
            augmenting, 52
      pack, 378
      readlines, 296
      registering, 1417
      set, 465
      Set class, 1303
      stack module/Stack class, 1285
      strings, 95-97
      writelines, 296
MFC (Microsoft Foundation Classes), 370
mhlib module, 719
mimetypes module, 286
mirroring web sites, 786
mixin classes, 584-586
mod_python package, 1192
modal dialogs, 427
      custom, 441
Modulator system, 1462
modules
      binary data, encoding, 719
      C extension, 1409
            code reuse and, 1503
            compiling, 1412
            linking, 1413
            string stacking, 1434
            structure of, 1417
            wrapping environment calls, 1428
      CGI scripts, 719
      creating servers, 1189
            with Medusa, 1190
            with Zope, 1191
      data, encoding, 719
      Dialog, 439-440
      documentation, 92
      email, 719
            client configuration, 810
      fcntl, 92
      find, 170
      FTP, 719
      glob, 92, 161-163
      Gopher, 719
      HTML, 719
      HTMLgen, 1145
      IMAP, 719
      Internet, 718
      loaded, 102
      MIME, 719
      mimetypes, 286
      network communications, 719
      os, 92, 104
            administrative tools, 106
            exits, 202-203
            interfaces, 105
            portability, 107
      packages, 164
      pickle
            persistence and, 41-43, 45-47
      Python extensions in C/C++, Jython and, 1158
      Queue, 195-197
      queue, 92
      regular expressions, 1346
      servers, 719
      SGML, 719
      signal, 218
      socket, 92
      stacks as, 1282
      string, as object methods, 1338
      StringIO, 137
            stderr, 138
      sys, 92
            platforms, 101
            search path, 101-102
            versions, 101
      Telnet, 719
      thread, 92, 185-193
      threading, 193-195
      time, 92
      translating to C, 1344
      URLs, 719
      utility
            for email browser, 1106
            text-processing, 1337
      web pages, 719
      webbrowser, 285, 292
      XML, 719
Monty Python, 8
      theme song, 778
multifile module, 719
multimedia
      viewing in browsers, 283
multiplexing servers, with select(), 747

N[ Top ]
named pipes, 209, 216-218
names
      fields, 27
namespaces, running code strings with, 1471
nesting
      dictionaries and, 32
Network News Transfer Protocol (NNTP), 862
newsgroups, 12
newsgroups, accessing, 862
NNTP (Network News Transfer Protocol), 862
nntplib module, 719, 862
Nodiffsfound message, 355
nonmodal dialogs, 428
notes slideshow program, 668-676

O[ Top ]
Object Linking and Embedding (OLE), 1176
object model API, 1169
Object Request Broker, 1132
object viewers, 1323
      persistent, 1257
object-oriented databases (OODBs), 1215
object-oriented programming (OOP), Python and, 1514
objects
      callable class objects
            callback handlers, 398
      callable, embedded Python code and, 1465
      callback handler, registering, 1478
      code strings, running with, 1473
      converting
            to strings, pickled objects and, 1202
            to/from C datatypes, 1417
      database connection, 1230
      database cursor, 1230
      datatypes and, 1280
      DBM file, 1199
objects (continued)
      file objects
            built-in, 143-152
      files, grep utility, 1356
      ftp
            quit(), 770
            retrbinary(), 769, 774
            storlines(), 794
      graphs, 1322
      HTMLgen, 1146
      Jython, 1152
      mapping URLs into calls on, 1133
      persistent, shelves and, 1210
      pickled, 1201
            shelves, 1207
      publishing, 1133
            COM and, 1176
      redirecting streams to, 134-137
      sequences, 1316
            permutations of, 1318
            reversing, 1316, 1322
            sorting, 1320, 1322
      sharing between web pages, 1030
      socket
            accept(), 724
            bind(), 723
            close(), 724, 725
            connect(), 725
            listen(), 724
            recv(), 724, 725
            send(), 724, 725
            setblocking(), 752
            socket(), 723, 725
      stacks, 1281
      stored, changing classes of, 1211
      Toplevel, 422
      Zope
            as database for storing, 1132
            ORB and, 1132
OLE (Object Linking and Embedding), 1176
OODBs (object-oriented databases), 1215
OOP (object-oriented programming), 47
      behavior, 50
      classes, 48-49
            alternative, 53
      constructors, customization, 53
      customization, 48
      encapsulation, 48
      format, display, 52
      GUIs, 62
      inheritance, 50-52
      methods, augmenting, 52
      persistence, 55-57
      Python and, 1514
      structure, 48
open modes, files, 154
open source nature, 6
open source software, compared to commercial, 639
operators, stack versus module, 1285
optimization
      C extension files, 1447
      performance, 1291
      sets, 1302, 1303
      stacks, 1287
      vs. integration, 1502
Option menu widget, 507
ORB (Object Request Broker)
      Zope, 1132, 1134
            URLs, mapping into calls on Python objects, 1133
os module, 90, 92, 104
      administrative tools, 106
      exits, 202-203
      file tools, 153-156
      interfaces, 105
      os path, tools, 107-109
      os.environ, 113
      os.execlp, 113
      os.fork, 113
      os.mkdir, 113
      os.mkfifo, 113
      os.open, 113
      os.path.walk, 113
      os.pipe, 113
      os.remove, 113
      os.spawnv, 113
      os.stat, 113
      os.walk, 113
      portability, 107
os path module, tools, 107-109
os._exit(), forking servers and, 736
os.chmod(), uploading client files to web servers, 1057
os.exec, formats, 181
os.fork, 176
      servers, forking, 733
os.getpid, 178
os.listdir, 163, 793
os.path.isdir, 804
os.path.join, 793
os.path.samefile, restricted file access, 1051
os.path.split, 1060
os.path.walk, 165
      directories, renaming, 331
      directory trees, 113, 329, 343
      files, renaming, 331
      recursion, 169
      rewriting filenames, 310
os.popen, 160-161
      email, sending, 817
      Linux, 122
      os.listdir() and, 163
      shell commands, 110
      streams, 109
            redirection, 139
os.remove, 347
os.rmdir, 347
os.spawn calls, 222
os.startfile call, 229
os.system, FTP client frontend, 757
os.waitpid, zombies, killing, 737
os.walk
      generating, 167
      recursion, 169
output files, 143-145

P[ Top ]
pack geometry manager
      alternatives to, 543
      columns, spanning, 550
      rows, spanning, 550
      widgets, resizing, 382, 404
            anchor option, 405
            clipping, 402
            expansion, 388
pack widget method, 378
PackDialog class, 601
packer geometry manager (Tkinter), 378
packer, FTP client frontend and, 759
packing
      files, 254-265
      scrollbars, 515
padding, labels, 421
painting, PyDraw, 676-685
parallel processing, 175
parent processes, forking servers and, 735
parse tree interpreter
      adding to parsers, 1367
      exploring, 1374
      structure, 1372
parsing binary data, struct module, 152
parsing rule strings, 1342
passwords
      encrypting, 1066
      escaping in HTML, 1094
      in hyperlinks, encrypted, 1088
      on POP page, 1081, 1100
PATH, CGI scripts and, 980
paths, Unix executable, changing, 334-336
PBF (Python Business Forum), 9
PEP (Python Enhancement Proposal), 9
performance, 21
      C extension files, 1447
      email browser, 1123
      forking and, 742
      HTMLgen and, 1149
            CGI and, 1145
      Jython, 1159
      Python
            profiler, 1300
            scripts integrated with C/C++, 1405
      reading from files, 158
      sets, 1299
      stacks, 1286
      threads and, 183
Perl, Python compared to, 1510, 1524
permissions
      CGI scripts and, 980
      directory trees
            fixing, 332-334
      HTML files, 977
permute(), 1319
persistence
      databases, 1198
      formatted files, 35-41
      object viewer, 1254
      OOP, 55-57
      pickle module, 41-43
            per-record files, 43-45
            shelves, 45-47
      pickled objects, 1201
      Python and, 1197
      scripts
            format, 38
            test, 35
            utilities, 40
Persistent class, 1133
Pexpect, stream buffers, 216
PhotoImage object, 478
pickle module, 1202
      persistence and, 41-43
            per-record files, 43-45
            shelves, 45-47
      shelve module and, 1207
pickle.dump(), 1202
pickle.dumps(), 1202
pickle.load(), 1202
pickle.loads(), 1202
pickle.Pickler(), 1202
PickleDictionary class, 1133
Pickler class, 1203
      constraints, 1214
PIL (Python Imaging Library)
      image types, 485-488
      images
            displaying, 484
            thumbnails, 489-498
      installation, 485
      overview, 484
      Tkinter and, 374
ping command, 728
pipes, 209
      anonymous, 209-212
      bidirectional IPC, 212-216
      deadlocks, 214
      flushes, 214
      GUIs, 630
      named, 209, 216-218
      redirecting streams and, 127-128
      unbuffered streams, 214
pipes-nongui.py, 633
Playfile.py, 265
Pmw, Tkinter and, 373
POP (Post Office Protocol)
      mail interface, utility modules, 1107
      message numbers, 908
      module, 719
      passwords, 1081, 1100
      retrieving email, 809, 889
            from browser, 1080
      servers, connecting to, 813
poplib module, 719, 812
      email client, 889
poplib.POP3(), 813
port numbers, 715
      clients, 717
      reserved, 717, 720
            client connections and, 732
            talking to, 731
      servers, 717
portability, 5
      email
            browser, 1124
            clients and, 879
      forking and, 742
      Jython, 1159
      os module, 107
      select() and, 751
      signal handlers and, 741
      threading and, 184, 743
portable media file player tool, 285-291
position, widgets, 405
Post Office Protocol, 719
ppembed API, 1486, 1495
      running code strings with, 1487
      running customizable validations, 1489
      running objects with, 1486
press coverage, 13
printing dialog results, 435
processes
      child
            exiting from, 736
            forking servers and, 735
      communicating between, 208-209
      exits, 205-206
      parent, forking servers and, 735
      signals, 218-221
      zombies
            killing, 736
            preventing, 738
processing
      handcoded parsers, 1359
            expression grammar, 1359
            tree interpreter, adding, 1367
      parser generators, 1357
      rule strings, 1342
      text, 1336
            summing columns, 1340
productivity, speed of development, 4
program launchers, automated, 265-291
programming
      event-driven, 377
      sockets, 720
            client calls, 725
            server calls, 723
programs
      launching, 230
            without environment settings, 267-277
      socket
            running locally, 726
            running remotely, 727
      starting, 221-230
protocols
      Internet, 710, 766
            message formats, 716
            modules, 719
            structures of, 718
      standards, 720
prototyping, 1517
      rapid, 17
PSA (Python Software Activity), 8
pseudocode, executable, 5
PSP (Python Server Pages), 1186
pty, stream buffers, 216
Py_BuildValue(), 1419, 1473
Py_CompileString(), 1476
Py_DECREF(), 1421
Py_INCREF(), 1421
Py_Initialize(), 1471
Py_XDECREF()/Py_XINCREF(), 1422
PyArg_Parse(), 1418, 1471, 1473
PyArg_ParseTuple(), 1418
PyCalc example, 1377
      components
            adding buttons to, 1398
            using PyCalc as, 1396
      source code, 1390
PyClock, 685-700
      changes in, xxiv
      source code, 692
PyDemos, 571, 572-579
PyDemos.pyw, xxxviii
PyDemos2.pyw, 266
PyDict_GetItemString(), 1475
PyDict_New(), 1474
PyDict_SetItemString(), 1475
PyDraw, 676-685
      source code, 677
PyEdit, 638-657
      as standalone, 639
      changes in, xxiv
      dialogs, 641
      embedded mode, 640
      menus, 640
      pop-up model, 640
      running, 640-644
      source code, 645
      toolbars, 640
PyErr_SetString(), 1420
PyEval_CallObject(), 1473
PyEval_EvalCode(), 1476
PyEval_GetBuiltins(), 1475
PyForm, 1254
      data as code, 1273
      GUI code, 1257
      limitations, 1276
      SQL databases, 1275
      table wrappers, 1263
      utility scripts, 1268
      ZODB databases, 1275
PyFtpGui, 785
PyGadgets, 571, 579-582
PyGadgets.py, xxxvi, xxxviii
PyGadgets_bar.pyw, xxxvi, xxxviii
PyGTK, 369
PyImport_ImportModule(), 1471, 1473
PyMail, 831-839
      console client, 836
            updates, 857
PyMailCGI
      changes in, xxiv
      configuration, 1072
      error pages, 1077
      fetched mail, processing, 1097
      messages
            composition, 1073
            deleting, 1099
            forwarding, 1098
            reading, 1080
            replying to, 1098
            selecting, 1082
            sending, 1073
            view page, 1090
      passwords, escaping, 1094
      root page, 1070
      security, 1088
      send mail script, 1075
            outside browser, 1078
      utility modules, 1106
      web site, 1064
PyMailGUI
      attachments
            sending, 894
            viewing, 896
      changes in, xxiv
      code reuse, 912
      code structure, 912
      general purpose GUI pop-ups, 942
      globals, 915
      implementation, 911
      interacting with, 883
      load server interface, 890
PyMailGUI (continued)
      mailconfig, 946
      Main module, 913
      messages
            cache manager, 939
            deleting, 906
            displaying, 887
            forwarding, 903
            loading, 887
            replying, 903
            sending, 894
            viewing, 896
      offline processing, 892
      passwords, 888
      POP message numbering, 908
      presentation, 881
      reasons to use, 879
      running, 880
      source code, 877
      starting, 883
      status messages, 910
      threading, 889
      user help text, 949
      user settings, 946
      windows, 884
            list windows, 916
            message windows, 931
            multiple, 910
      wraplines, 944
PyModule_GetDict(), 1471
PyObject type, 1152
PyObject_GetAttrString(), 1473
PyObject_SetAttrString(), 1471
PyPhoto, 657-668
      changes in, xxiv
      running, 658
      source code, 662
PyPi, 8
PyQt, 369
Pyrex, 1461
PyRun_SimpleString(), 1467
PyRun_String(), 1471, 1475
Python
      C# compiler, 1186
      C/C++ and, 1154
            integration, 1405
      CGI scripts and, 965
      changes in, xxiii
      compared to other languages, 1510, 1517
      compatibility with Jython, 1158, 1159
      databases and, 1228
      development cycle, 1512
      embedded-call API, 1463
      embedding, 1382
      as executable pseudocode, 1513
      features of, 1512, 1518
      growth, 14
      history of, 8
      integrating with CORBA, 1501
      Internet connections and, 713
      Internet uses for, 712
      Java and, 1520
      OOP and, 1514
      overview, xxvi
      persistent data and, 1197
      profiler, performance and, 1300
      registering with Internet Explorer, 1171
      uses, 17
      web servers, finding on, 981
      XML support, 1165
Python 2.4, book updates, xxviii
Python Cheese Shop, 8
Python Server Pages (PSP), 1186
Python.h header file, 1417
PythonCard, 370
pythoncom.CreateGuid(), 1181
PythonInterpreter API, 1500
PythonInterpreter class (Jython), 1152
PYTHONPATH
      CGI scripts and, 980
      HTMLgen and, 1149
      Pickler class and, 1214
PythonWin IDE, 1172
PyToe, 700-704
PyTree example, 1323
      parse trees, 1333
      source code, 1326, 1330
PyView, 668-676
      running, 668
      source code, 670

Q[ Top ]
query strings, web interface, 76-77
Queue module, 92, 195-197
queues
      callbacks on, 620
      GUIs and, 616-624
      threads, 184
Quit button, dialogs, 430
quopri module, 719

R[ Top ]
radiobuttons, 456, 460
      callback handlers, 458
      command option, 456, 460
      configuring, 419
      dialogs, 427
      Entry widgets, 448
      HTML forms, adding to, 1001
      Message widgets, 448
      value attribute, 460
      variable option, 456
      variables, 463
      variables and, 462
      windows, top-level, 422
random module
      GIF files, 481
raw_input(), 815
re module, 1346, 1348
      functions, 1349
re.compile(), 1349
re.match(), 1349
re.search(), 1349
re.split(), 1349
re.sub(), 1349
re.subn(), 1349
read(), Unpickler class, 1203
readable code, 4
reading files, iterators and, 146-148
readlines method, 296
readlines(), 158
reapChildren(), 737
record dictionaries, 1239
records, lists, 25
recursion
      os.path.walk, 169
      os.walk, 169
redirectedGuiFunc function, 605
redirectedGuiFunc(), 605
redirectedGuiShellCmd function, 605
redirection
      to files, 125-126
      to objects, 134-137
      coding alternatives, 129
      pipes and, 127-128
      print statements, 139
      reading keyboard input, 130-134
      StreamApp class, 259
      streams to widgets, 605
      user interaction and, 130
      using for packing scripts, 608
refactoring uploads/downloads, 795-803
reference count management, 1421
regex module, 1346
      migrating code using, 1347
Register_Handler(), 1479
registering methods, 1417
regression test script, 251-253
regular expressions, 1346
      compiled pattern objects, 1349
      match objects, 1350
      patterns, 1350
      re module, 1348
      vs. string module, 1344
relational algebra, adding to sets, 1303
reload(), 609
      callback handlers and, 610
ReplaceVisitor class, 323
replies, web interface, text format, 77
return values, 1418
reusable tools, 307
reusing downloads/uploads, 795-803
rfc822 module, 719
      email client, 904
rotor module, 1109
rule strings, 1342
running code, 19

S[ Top ]
scales, 465-468
      command option, 465
      labels, 466
      linking, 468
      variables, 467
scheduled callbacks, 559
Scheme, Python compared to, 1510
scripting
      Internet, 17, 711
      overview, 90
scripting languages, 3
scripts
      CGI, 979
      client-side, 766
            email, 808
            files, transferring over Internet, 767
            newsgroups, 862
            PyMailGUI, 876
            web sites, accessing, 866
      executable
            Unix, 120
      execution, context, 113-114
      format, persistence, 38
      Jython, compared to Java, 1153
scripts (continued)
      page generator, forward link files, 248
      Python in Java applications, 1150
      regression test script, 251-253
      server-side, 962
            URLs, 962
      shell commands, 109-112
      shelve-based, 46
      starting programs, 227
      test, persistence, 35
      utility, persistence, 40
scrollbars, 511
      packing, 515
      programming, 514
ScrolledText class, 586
scrolling thumbnails, 497
search_all, 317
searches
      binary search trees, 1307
      directory trees, 311-316
      graphs, 1312
      grep utility, 1356
      sys module, 101-102
SearchVisitor class, 317, 325
secret module, 1109
security
      CGI scripts and, 997
            HTTP servers running, 980
      examples in book, 1116
      passwords
            encrypting, 1066
            escaping in HTML, 1094
            in encrypted hyperlinks, 1088
            on POP page, 1081, 1100
      PyMailCGI, 1088
      web server files, displaying on browsers, 1051
select module, 748
select(), servers, multiplexing, 747
sendmail program, 817
sequences, 1316
      objects, 1445
      permutations of, 1318
      reversing, 1316, 1322
      sorting, 1320, 1322
            comparison functions, 1321
serial ports, 765
serialized byte streams, 41
SeriesDocument class (HTMLgen), 1147
server function, 755
server.getfile(), web sites, accessing, 867
server.sendmail(), 819
servers, 722
      asynchronous, 747
      COM, 1179
            GUIDs, 1180
            using from clients, 1181, 1182, 1184
      connecting to, 794
      creating, 1189
            Apache, 1192
            Mailman, 1192
            tools for, 1190
            with Python code, 1189
      email, 819
      file, 753
            frontend, adding, 757, 779
      forking
            multiple clients, handling with, 733
            zombies, killing, 736
            zombies, preventing, 738
      FTP
            closing connection, 770
            opening connection to, 769
      HTTP, 964
            CGI scripts and, 980
      multiple clients, handling, 732
            with classes, 744
      multiplexing, 747
      POP, connecting to, 813
      scripts, 962
      sending files to, 1046
      socket calls, 723
      socket programs, running locally, 726
      threading, 742
      web, 717
            email client and, 1125
            finding Python on, 981
            uploading client files to, 1053
            Zope, 1130
server-side databases, 1018
services, 13
Set class, 1296
      methods, 1303
set method, 465
setops(), 1299
sets, 1293
      classes, 1296
      functions, 1294
      moving to dictionaries, 1297
      relational algebra, adding to, 1303
SGML (Standard Graphic Markup Language) module, 719
sgmllib module, 719, 1165
shell
      listing commands, 160-161
      tools, 598
      variables
            changing, 121
            fetching, 119-121
shell commands, 109-112
shell variables, faking inputs on forms with, 1039
ShellGui, 597-605
ShellGui class, 599
shellgui module, 600
shelve interface
      console and, 57-60
      GUI, 65-70
      web-based, 78-86
shelve module
      concurrent updates and, 1213
      pickle module and, 1207
shelves, 1207
      constraints, 1212
      file operations, 1208
      OODBs and, 1215
      persistence and, 45-47
      storage
            classes, 1210
            object types, 1209
            objects, changing classes of, 1211
signal handlers, zombies, preventing with, 738
signal module, 218
signal.signal(), zombies and, 741
signals, 218-221
Simple Mail Transfer Protocol, 719
SimpleDocument class (HTMLgen), 1147
SimpleHTTPServer module, 720, 1189
Simplified Wrapper and Interface Generator (SWIG), 1423
SIP, 1460
sliders (see scales)
slideshow program, 668-676
Smalltalk, Python compared to, 1511
smart links, 1011
SMTP (Simple Mail Transfer Protocol)
      date formatting standard, 825
      module, 719
      sending mail, 817
            from browser, 1073
smtplib module, 719, 817
      email, sending from browser, 1076
smtplib.SMTP(), 819
SOCK_STREAM variable, socket module, 723
socket module, 92, 719, 721
      variables, 723
socket object, 721
      accept(), 724
      bind(), 723
      close(), 724, 725
      connect(), 725
      listen(), 724
      recv(), 724, 725
      send(), 724, 725
      setblocking(), 752
      socket(), 723, 725
sockets, 627, 710, 714-716, 728
      blocking/unblocking, 752
      calls
            client, 725
            server, 723
      CGI scripts and, 965
      identifiers for machines, 715
      IP addresses, 715
      machine names, 715
      message formats, 716
      multiplexing servers and, 748
      port numbers, 717
      programming, 720
      programs
            running locally, 726
            running remotely, 727
      select() and, 751
SocketServer module, 719
SocketServer.TCPServer class, 1189
sort(), 1322
source code
      line counting, 336-339
      PyClock, 692
      PyEdit, 645
      PyMailGUI, 877
      PyPhoto, 662
      PyView, 670
spam, 820, 823
speed, 21
speed of development, 4
split(), 1339
splitpath(), 1060
splitting files, 237
      binary files and, 240
      command-line mode, 239
      interactive mode, 239
      manually closing, 240
      portably, 237-240
      usage, 244-247
SQL (Structured Query Language), 1227
      utility scripts, 1247
Stack class, 1284
      optimizing, 1287
      performance, 1286
stack module, 1282
      methods, 1285
stacks, 1281
      as lists, 1281
      optimizing, 1287
standalone container classes, 412
standard dialogs, 428
Standard Graphic Markup Language (SGML) module, 719
standard library, 91
starting programs, 221-230
state
      labels, 421
      top-level windows, 426
static binding, 1414
static language build cycle, 1509
status messages, suppressing, 326-329
storage
      object types, 1209
      persistent, 1128, 1197
            DBM, 1198
            pickled objects, 1201
_str_, 1146
StreamApp class, 259
      redirection and, 259
streams, 123
      buffers
            Pexpect, 216
            pty and, 216
      CGI and, 965
      pickled, 1203
      redirecting
            coding alternatives, 129
            to files, 125-126
            to objects, 134-137
            pipes and, 127-128
            print statements, 139
            reading keyboard input, 130-134
            to widgets, 605
            user interaction and, 130
      unbuffered, 630
string module, 1337
      vs. regular expressions, 1344
string.atoi(), 1337
string.find(), 1337
string.join()
      text processing, 1339
string.replace(), 1337
      email client, 904
string.split(), 1339
      text processing, 1339
string.strip(), 1337
string.upper(), 1337
StringIO module, 137
      stderrr, 138
strings
      converting
            in CGI scripts, 997
            objects to, pickled objects and, 1202
      documentation, 93-95
      methods, 95-97
      raw, 1023
      regular expressions, 1346
            compiled pattern objects, 1349
            match objects, 1350
            patterns, 1350
            re module, 1348
      rule, 1342
struct module
      binary data, parsing, 152
Structured Query Language (SQL), 1227
subclasses, protocols, 590
subset(), 1319
summing columns, 1340
superclasses, application hierarchies, 259-265
SWIG (Simplified Wrapper and Interface Generator), 1422
      C extension module string stack, 1439
      C structs, 1427
      C variables and constants, 1427
      C++ class integration, 1427
      wrapping C environment calls, 1433
      wrapping C++ classes, 1451
synchronization, threads, 184
sys module, 90, 92
      exceptions, 103
      platforms, 101
      streams, 123
      versions, 101
sys modules
      search path, 101-102
sys path, 101
sys.exit(), vs. os._exit(), 736
sys.modules attribute, 1417
sys.stderr, error messages, trapping, 998
sys.stdout, error message, trapping, 998
system tools, 89
system utilities, 17
systems application domain, 89

T[ Top ]
Table class (HTMLgen), 1147
tables on web pages
      adding, 982
      laying out forms, 994
      tags, 984, 994
Tcl language, 416
Tcl/Tk, 416, 1510
TCP objects, 723
TCP/IP, 710
      socket module, 719
tear-offs, menus, 501
Telnet, 786
telnetlib module, 719
templates, web pages, forward link files, 248
testing
      GuiMaker self-test, 592
      mixin methods, 586
      persistence, 35
      regression test script, 251-253
      sequence permutations, 1319
      set classes, 1296
      set functions, 1295
text
      advanced operations, 527
      clipboard and, 524
      composition, inheritance and, 526
      editing, 522
      files
            distinguishing from binary, 789
            uploading, 793
      labels, 420
      processing, 1336
            parser generators, 1357
            regular expressions, 1346
            rule strings, 1342
            summing columns, 1340
            utilities, 1337
      ScrolledText class, 586
      widgets, 517
text editors, PyEdit
      example, 638-657
text widget, programming, 519
thread module, 92, 185-193
threading module, 193-195
threads, 176, 183
      C API, 201
      exits, 191, 206-208
      function calls, 184
      GIL and, 184, 197-201
      GUIs and, 198, 560, 616-624
      memory and, 183
      performance and, 183
      portability and, 184
      queues, 184
      synchronization, 184
      threading servers, 742
thumbnails
      PIL, 489-498
      scrollable, 536
      scrolling, 497
tic-tac-toe game, 700-704
time module, 92
time.sleep()
      client requests, 734
      servers, multiplexing, 751
time.strftime(), 825
time/date formatting, 825
timer module, 1290, 1299
time-slicing, 747
titles, top-level windows, 426
Tix, Tkinter and, 373
Tk library, 416
tkFileDialog module, 434
Tkinter, 60, 367, 371
      animation techniques, 564
      Button class, 387
      callback handlers, user-defined, 389-401
      callbacks, protocols, 399
      canvas widgets, 529
      checkbuttons, 456-460
            adding to HTML forms, 1001
            configuring, 419
            dialogs, 427
            Entry widget, 448
            Message widget, 448
            variables and, 458
            windows, top-level, 422
      classes, container, 412
      coding, 377-380
      coding alternatives, 380
      documentation, 372-373
      events, binding, 400
      extensions, 373-374
      FTP client frontend, 757
      Grail and, 1161
      grids, 543
      IDLE and, 374
      images, 478-483
      listboxes, 511
      menus, 499, 593
      object viewers, 1323
            persistent, 1257
      pack widget method, 378
Tkinter (continued)
      packer geometry manager, 378
      PIL and, 374
      Pmw and, 373
      radiobuttons, 456, 460
            adding to HTML forms, 1001
            configuring, 419
            dialogs, 427
            Entry widget, 448
            Message widget, 448
            variables and, 462
            windows, top-level, 422
      scales, 465-468
      scrollbars, 511
      sliders, 465
      structure, 374
      Tcl/Tk and, 416
      text, 517
            editing, 522
      Tix and, 373
      toolbars, 593
      variable classes, del destructor, 464
      variables, 453
      widgets
            appearance, 419-422
            clipping, 402
            configuration, 383
            creating, 378
            customizing with classes, 406-408
            Entry, 448-455
            expansion, 388
            Message, 448
            multiple, 401-406
            Optionmenu, 507
            packing, 385
            positioning, 405
            resizing, 381
toolbars, 593
      automation, 586-597
Toplevel object, 422
top-level windows
      geometry, 426
      icons, 426
      killing, 425
      menus, 426, 500-503
      state, 426
      titles, 426
translating
      conversion codes, 1419
      Tcl/Tk to Python/Tkinter, 416
trees, walking generically, 317-339
Trigger_Event(), 1480
try/finally statements, mailboxes, unlocking, 813
type declarations, lack of, 5

U[ Top ]
UDP (Uniform Datagram Protocol), socket module, 719
unbuffered streams, 630
      pipes, 214
Uniform Datagram Protocol (UDP), socket module, 719
unique function, 352
Unix
      end-of-lines, CGI scripts and, 980
      executable path lines, changing, 334-336
      scripts, executable, 120
      web servers, finding Python on, 982
unpacking files, 254-265
unparsing, 1342
Unpickler class, 1203
updates, xl
uploads, reusing, 795-803
urllib module, 719, 966
      files, FTPing, 771
      state information in URL parameters, 1086
      URLs, escaping, 1041
      web sites, accessing, 869
urllib web interface, 76-77
urllib.quote(), URLs, escaping, 1041
urllib.quote_plus(), URLs, escaping, 1041
urllib.urlencode(), 1086
urllib.urlretrieve(), 772
Urlparse module, 719
URLs (Uniform Resource Locators), 964, 973
      components of, 974
            minimal, 976
      embedded in hyperlinks, 988
      escaping, 1041
            conventions, 1039
      form tags, embedded in, 988
      hardcoded, passing parameters in, 1007
      hyperlinks, embedded in, 976
      module, 719
      parameters
            passing, 990
            passing state information, 1084
      parsing, 719
      passwords encrypted in, 1088
      text in, escaping, 1024
      web sites, accessing, 869
      Zope
            invoking functions through, 1134
            mapping into calls on objects by, 1133
user interaction, adding to CGI scripts, 986
users
      groups, 13
      growth of, 9
      input, 64
      stream redirection and, 130
uses of Python, 17
utilities
      email browser, 1106
            external components, 1106
            POP interface, 1107
      scripts
            persistence, 40
      text processing, 1337
uu module, 719

V[ Top ]
van Rossum, Guido, 8
variables
      checkbuttons, 458
      radio buttons, 462, 463
      scales, 467
      shell
            changing, 121
            faking inputs on forms with, 1039
            fetching, 119-121
Vaults of Parnassus, 8
visitors
      copied directory trees, 343
      fixers and, 329-332

W[ Top ]
walking directories, 159-164
      trees, 164-170
Web
      applications, trade-offs, 1122
      CGI scripts and, 963
      client/server architecture, 964
      servers, 717
web browsers, 732
      launching
            command lines and, 280
            function calls, 282
            portably, 277-284
      multimedia, viewing in, 283
web interface, 70
      CGI, 70-73
      query strings, 76-77
      reply text format, 77
      urllib, 76-77
      web server, 73-76
web pages, 972
      cgi module, parsing user input, 989
      CGI scripts and, 977
      email
            forwarding, 1098
            passwords, 1081, 1100
            replying to, 1098
            selecting, 1082
            sending, 1073
            viewing, 1090
      forms on, 964
            changing, 1003
            hidden fields in, 1020
            laying out with tables, 994
            mocking up inputs, 1024
            reusable, 1034
            selection list, 1020
            tags, 986
      forward-link, generating, 247-250
      graphics on, adding, 982
      HTMLgen, 1145
      modules, 719
      opening, remote servers, 282
      sharing objects between, 1030
      tables on
            adding, 982
            tags, 994
      templates
            forward-link files, 248
            Zope and, 1132
web servers, 717
      email client and, 1125
      finding Python on, 981
      uploading client files to, 1053
      web interface, 73-76
web sites
      accessing, 866
            httplib module, 866
            urllib module, 869
      downloading, 786
            deleting files when, 788
      from CGI scripts
            email, 1080
            root page, 1070
      mirroring, 786
web sites (continued)
      uploading, 791
            with subdirectories, 803
      user interaction, adding, 986
      Zope, 1130
webbrowser module, 285, 292
whichdb module, 1201
widgets
      canvas, 529
            scrolling, 533
      creating, Tkinter, 378
      Frame, 401
            attaching widgets, 403
      gridded, 543
      GUIs, 373
      input
            adding to HTML forms, 999
            missing/invalid, checking for, 1027
      packing order, 403
      redirecting streams to, 605
      resizing, 382, 388, 402
            anchor option, 405
      text, 517
            editing text, 522
      Tkinter
            appearance, 419-422
            clipping, 402
            configuration, 383
            customizing with classes, 406-408
            Entry, 448-455
            expansion, 388
            message, 448
            multiple, 401-406
            Optionmenu, 507
            packing, 385
            positioning, 405
            resizing, 381
win32all package, 1172, 1176
win32COM extensions, 1172
Windows
      client requests and, 734
      COM and, 1501
      DBM and, 1201
      forking servers and, 734
      Internet Explorer, 1169
      launching programs, 225
      serial ports on, 765
      server processes, killing, 730
      web scripting extensions, 1169
            Active Scripting, 1169
            ASP, 1174
            COM, 1175
windows
      GUI, popup, 625
      independent, 472
      interfaces, 611-616
      menus, toolbars and, 508-511
      toolbars, menus and, 508-511
      top-level (see top-level windows)
      wrapper classes, 611
WPY, 370
wrapper classes, windows, 611
write(), Pickler class, 1203
writelines method, 296
wxPython, 368
wxWidgets, 368

X[ Top ]
xdrlib module, 719
XML (Extensible Markup Language)
      module, 719
      processing tools, 1164
xmllib module, 719, 1165

Y[ Top ]
YAPPS (Yet Another Python Parser System), 1359

Z[ Top ]
ZODB
      classes, 1221
      database creation, 1218
      installation, 1217
zombies
      killing, 736
      preventing, 738
Zope, 709, 1130, 1191
      components, 1130
      forms and, 1135
      HTML document templates, 1132
      hyperlinks and, 1134
      object database, 1132
      ORB, 1132, 1134
      Python objects, publishing, 1133
Zope web application toolkit, 9

	

Zurück zu Programming Python


Themen

Buchreihen

Special Interest

International Sites

O'Reilly China O'Reilly France O'Reilly USA O'Reilly Japan O'Reilly Taiwan