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

(yzsuai) #1

advanced operations, 548–550
functionality, 411, 528–530
get method, 532
index support, 531
mark_set method, 532
programming, 530–533
PyMailGUI program and, 1053, 1118
search method, 533
tag support, 532
tag_add method, 532
tag_bind method, 548
tag_delete method, 533
tag_remove method, 533
text-editing operations, 533–538
Unicode and, 538–548
xscrollcommand option, 526
xview method, 526
yscrollcommand option, 526
yview method, 526
text-mode transfers, 882
this module, 70
Thread class, 199
_thread module
allocate_lock function, 194
basic usage, 189–191
coding alternatives, 197–199
functionality, 76
running multiple threads, 191–193
start_new_thread function, 190
synchronizing access, 193–195
waiting for spawned thread exits, 195–197
ways to code threads, 191
threading module
functionality, 76, 199–201
synchronizing access, 202–204
thread exits in GUIs, 639
timer function, 210
ways to code threads, 201
threads
advantages using, 186
animation and, 594
anonymous pipes and, 227
exit considerations, 220–222, 639
global interpreter lock and, 211–213
GUIs and, 208–210, 584–585, 657
potential usage downsides, 187
PyEdit text editor, 685
PyMailGUI program and, 1015, 1027–
1030


queue module, 204–208
servers and, 815–818
shared state, 220–222
spawned, 178
_thread module, 189–199
threading module, 199–204
time.sleep loops, 592
thumbnails, 560
(see also PyPhoto image program)
creating, 496–505
scrollable canvases and, 557–560
time module
functionality, 76
sleep call, 180, 588, 589–590, 592
timeit module, 76
timer objects, 210
Tix extension toolkit
functionality, 358, 365
HList widget, 1116
Tk GUI library, 412
Tk widget class
coding example, 373
destroy method, 423
exporting methods, 422–426
functionality, 411, 421
iconbitmap method, 424
iconify method, 424
maxsize method, 424
menu option, 425, 508–511
protocol method, 423
quit method, 424
title method, 424
withdraw method, 424
tkinter module, 375
(see also specific widget classes; widgets)
after method, 210
coding alternatives, 372–373
coding basics, 369
configuring window titles, 375
createfilehandler tool, 583
documentation, 364, 767
extensions supported, 364–366, 596
functionality, 40–42, 358, 363
geometry managers, 370
implementation structure, 366
programming structure, 367
underscore character, 409
widget classes supported, 411
TkinterTreectrl third-party extension, 1116

Index| 1581
Free download pdf