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

(yzsuai) #1

status messages, PyMailGUI program, 1060–
1062
STOR string (FTP), 860
str object type
functionality, 82
string method calls, 1406–1408
Text widget and, 539–540
usage considerations, 545–546
string methods
basics overview, 80–82
endswith method, 1407
find method, 1407
format method, 1406
isdigit method, 1407
isupper method, 1407
join method, 94, 1407, 1409, 1413
pattern matching versus, 1418–1421
performance and, 1415
replace method, 1407, 1408
templating with replacements/formats,
1408
rjust method, 1407
rstrip method, 1407
split method, 1407, 1409, 1410
startswith method, 1407
strip method, 1407
summing columns in files, 1410–1412
upper method, 1407
string module
ascii_uppercase constant, 1408
background information, 1415
preset variables, 81
string methods and, 1408
Template feature, 1408
strings, 1416
(see also code strings; regular expressions)
converting, 82, 1161
converting objects to, 1309
formatting, 63–64
functionality, 1406
query, 57–59
shelve constraints, 1321
specifying positions, 531
Text widget as, 530
Unicode text in, 540–542
StringVar class, 454
strop module, 1415
struct module
functionality, 786


parsing binary data, 151–153
serial ports and, 851
unpack method, 152
subclassing
attaching class components, 405–407
attaching frames, 475
built-in types, 1383–1385
C++ class, 1509
customizing widgets with classes, 400–403
extending class components, 407
multiprocessing module and, 252–254
protocol considerations, 607
PyCalc program and, 1463
recursive uploads, 893
reusable GUI components, 403–410
subprocess module
exit status, 218
functionality, 76
Popen object, 101
redirecting streams, 128, 130–132
SumGrid class, 579
summer function, 1410–1412
SWIG tool, 1491–1495, 1500, 1502–1511
synchronization
inbox error potential, 1272
mailtools utility package, 968
PyMailGUI program and, 1051–1053
_thread module and, 193–195
threading module, 202–204
threads and, 187
sys module
argv parameter, 103, 106
command-line arguments, 106–108
current working directory, 104
documentation sources, 77
exception details, 89
exc_info function, 89
exit function, 214
functionality, 75, 77, 90
getdefaultencoding function, 148
getrefcount function, 89
loaded modules table, 88
module search path, 87, 104, 275
modules dictionary, 88
platform string, 87
platforms and versions, 86
program exits, 214, 379
setcheckinterval function, 211
standard streams and, 113–132

Index| 1579
Free download pdf