[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

newsgroups
accessing, 991–993
handling messages, 1121
NLTK suite, 1439
NNTP (Network News Transfer Protocol),
991–993, 1227
nntplib module, 786, 991–993
numeric tools, 750
NumPy programming extension, 750, 1484


O
object references
callback handlers as, 628
deferring calls, 384–385
object relational mappers (see ORMs)
Object Request Broker (ORB), 779
object types, storing in shelves, 1317
object-oriented databases (OODBs), 1304
object-oriented programming (see OOP)
objects
callable, 1516, 1524–1526, 1530–1535
changing classes, 1320
converting to strings, 1309
pickled, 1304, 1309–1315
sharing between pages, 1193–1196
shelve constraints, 1322
offline processing, PyMailGUI program, 1031–
1033
onSignal handler function, 242
OODBs (object-oriented databases), 1304
OOP (object-oriented programming)
adding behavior, 29
adding inheritance, 29
adding persistence, 34–36
alternative database options, 36
class considerations, 27–29
GUI considerations, 42–44
programming considerations, 26–27, 1550
refactoring code, 31–34
open function
buffering policy, 144
functionality, 135, 137
modes supported, 145
open source software, 673, 785
opening files, 138, 144
optimization
in-place list modifications, 1369–1370
moving sets to dictionaries, 1378–1382
tuple tree stacks, 1367–1369


Optionmenu widget class, 515
optparse module, 108
ORB (Object Request Broker), 779
ORMs (object relational mappers)
database options, 36, 778
functionality, 1304, 1354–1356
os module
administrative tools, 91
chdir function, 92, 104
chmod function, 159
close function, 230
dup function, 132
dup2 function, 230
environ mapping
accessing environment variables, 1497
accessing shell variables, 109
changing shell variables, 111
Env object, 1499
functionality, 100, 103
execl function, 183
execle function, 183
execlp function, 100, 182–184, 183
execlpe function, 183
execv function, 183
execve function, 183
execvp function, 183, 230
execvpe function, 183
_exit function, 215
fdopen function, 158, 226
file tools supported, 155
fork function
functionality, 100, 179, 230
os.execlp combination, 182–184
redirecting streams, 132
forking tools, 179
functionality, 75, 77, 90
getcwd function, 91, 103
getenv function, 113
getpid function, 91, 180
kill function, 243, 810
linesep character, 92
listdir function
fetching list of remote files, 876
handling Unicode filenames, 172
joining files, 288
printing Unicode filenames, 280
storing local files, 882
walking directory trees, 171
walking one directory, 167

Index| 1569
Free download pdf