Python 3: the comprehensive guide
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Boston, Ma
Rheinwerk Publishing
[2022]
|
Ausgabe: | 1st edition |
Schlagworte: | |
Online-Zugang: | Inhaltstext Inhaltsverzeichnis |
Beschreibung: | 1036 Seiten Illustrationen 25.4 cm x 17.8 cm |
ISBN: | 149322302X 9781493223022 |
Internformat
MARC
LEADER | 00000nam a22000008c 4500 | ||
---|---|---|---|
001 | BV048851514 | ||
003 | DE-604 | ||
005 | 20240503 | ||
007 | t | ||
008 | 230308s2022 gw a||| |||| 00||| eng d | ||
015 | |a 22,N26 |2 dnb | ||
016 | 7 | |a 1260567850 |2 DE-101 | |
020 | |a 149322302X |9 1-4932-2302-X | ||
020 | |a 9781493223022 |c pbk: EUR 56.03 (DE), EUR 59.95 (DE) (freier Preis), EUR 61.70 (AT) (freier Preis), CHF 76.95 (freier Preis) |9 978-1-4932-2302-2 | ||
024 | 3 | |a 9781493223022 | |
028 | 5 | 2 | |a Bestellnummer: 459/22302 |
035 | |a (OCoLC)1374560856 | ||
035 | |a (DE-599)DNB1260567850 | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
044 | |a gw |c XA-DE | ||
049 | |a DE-29T |a DE-B768 |a DE-898 |a DE-573 | ||
084 | |8 1\p |a 004 |2 23sdnb | ||
100 | 1 | |a Ernesti, Johannes |e Verfasser |0 (DE-588)13382621X |4 aut | |
240 | 1 | 0 | |a Python 3 (2021 : 6. Auflage) |
245 | 1 | 0 | |a Python 3 |b the comprehensive guide |c Johannes Ernesti, Peter Kaiser |
250 | |a 1st edition | ||
264 | 1 | |a Boston, Ma |b Rheinwerk Publishing |c [2022] | |
300 | |a 1036 Seiten |b Illustrationen |c 25.4 cm x 17.8 cm | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 0 | 7 | |a Python 3.x |0 (DE-588)7692360-5 |2 gnd |9 rswk-swf |
653 | |a Python client for SAP HANA | ||
653 | |a SAP Python | ||
689 | 0 | 0 | |a Python 3.x |0 (DE-588)7692360-5 |D s |
689 | 0 | |5 DE-604 | |
700 | 1 | |a Kaiser, Peter |e Verfasser |4 aut | |
710 | 2 | |a Galileo Press Inc. |0 (DE-588)106510992X |4 pbl | |
856 | 4 | 2 | |m X:MVB |q text/html |u http://deposit.dnb.de/cgi-bin/dokserv?id=4c8868641f334ddf841ae582072a7067&prov=M&dok_var=1&dok_ext=htm |3 Inhaltstext |
856 | 4 | 2 | |m DNB Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=034116778&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-034116778 | ||
883 | 1 | |8 1\p |a vlb |d 20220622 |q DE-101 |u https://d-nb.info/provenance/plan#vlb |
Datensatz im Suchindex
_version_ | 1804184971604131840 |
---|---|
adam_text | CONTENTS
1
INTRODUCTION
33
1.1
WHY
DID
WE
WRITE
THIS
BOOK?......................................................................
33
1.2
WHAT
DOES
THIS
BOOK
PROVIDE?.....................................................................
34
1.3
STRUCTURE
OF
THE
BOOK
....................................................................................
34
1.4
HOW
SHOULD
YOU
READ
THIS
BOOK?
................................................................
35
1.5
SAMPLE
PROGRAMS..........................................................................................
36
1.6
PREFACE
TO
THE
FIRST
ENGLISH
EDITION
(2022)
..................................................
36
1.7
ACKNOWLEDGMENTS
........................................................................................
37
2
THE
PYTHON
PROGRAMMING
LANGUAGE
39
2.1
HISTORY,
CONCEPTS,
AND
AREAS
OF
APPLICATION
................................................
39
2.1.1
HISTORY
AND
ORIGIN
..................................................................................
39
2.1.2
BASIC
CONCEPTS
........................................................................................
40
2.1.3
POSSIBLE
AREAS
OF
USE
AND
STRENGTHS
......................................................
41
2.1.4
EXAMPLES
OF
USE
......................................................................................
42
2.2
INSTALLING
PYTHON
...........................................................................................
42
2.2.1
INSTALLING
ANACONDA
ON
WINDOWS
..........................................................
43
2.2.2
INSTALLING
ANACONDA
ON
LINUX
.................................................................
43
2.2.3
INSTALLING
ANACONDA
ON
MACOS
..............................................................
44
2.3
INSTALLING
THIRD-PARTY
MODULES
.....................................................................
45
2.4
USING
PYTHON
................................................................................................
45
PART
I
GETTING
STARTED
WITH
PYTHON
3
GETTING
STARTED
WITH
THE
INTERACTIVE
MODE
49
3.1
INTEGERS
..........................................................................................................
49
3.2
FLOATS
..............................................................................................................
51
3.3
CHARACTER
STRINGS
...........................................................................................
51
3.4
LISTS
.................................................................................................................
52
3.5
DICTIONARIES
....................................................................................................
53
3.6
VARIABLES
.........................................................................................................
54
3.6.1
THE
SPECIAL
MEANING
OF
THE
UNDERSCORE
................................................
54
3.6.2
IDENTIFIERS
...................................................................................
55
3.7
LOGICAL
EXPRESSIONS
........................................................................................
55
3.8
FUNCTIONS
AND
METHODS
.................................................................................
57
3.8.1
FUNCTIONS
..........................
57
3.8.2
METHODS
.................................................................................................
58
3.9
SCREEN
OUTPUTS
...............................................................................................
59
3.10
MODULES
..........................................................................................................
60
4
THE
PATH
TO
THE
FIRST
PROGRAM
63
4.1
TYPING,
COMPILING,
AND
TESTING
...................................................................
63
4.1.1
WINDOWS
................................................................................................
63
4.1.2
LINUX
AND
MACOS
....................................................................................
64
4.1.3
SHEBANG
..................................................................................................
65
4.1.4
INTERNAL
PROCESSES
..................................................................................
65
4.2
BASIC
STRUCTURE
OF
A
PYTHON
PROGRAM
............................................................
66
4.2.1
WRAPPING
LONG
LINES
..............................................................................
68
4.2.2
JOINING
MULTIPLE
LINES
............................................................................
69
4.3
THE
FIRST
PROGRAM
..........................................................................................
70
4.3.1
INITIALIZATION
............................................................................................
71
4.3.2
LOOP
HEADER
............................................................................................
71
4.3.3
LOOP
BODY
....................
71
4.3.4
SCREEN
OUTPUT
.........................................................................................
72
4.4
COMMENTS
......................................................................................................
72
4.5
IN
CASE
OF
ERROR
...............................................................................................
72
5
CONTROL
STRUCTURES
75
5.1
CONDITIONALS
...................................................................................................
75
5.1.1
THE
IF
STATEMENT
....................................................................................
75
5.1.2
CONDITIONAL
EXPRESSIONS
........................................................................
78
5.2
LOOPS
..............................................................................................................
79
5.2.1
THE
WHILE
LOOP
......................................................................................
79
5.2.2
TERMINATION
OF
A
LOOP
.............................................................................
80
5.2.3
DETECTING
A
LOOP
BREAK
...........................................................................
81
5.2.4
ABORTING
THE
CURRENT
ITERATION
..............................................................
82
5.2.5
THE
FOR
LOOP
.............................................................................................
84
5.2.6
THE
FOR
LOOP
AS
A
COUNTING
LOOP
............................................................
85
5.3
THE
PASS
STATEMENT
.......................................................................................
87
5.4
ASSIGNMENT
EXPRESSIONS
................................................................................
87
5.4.1
THE
GUESSING
NUMBERS
GAME
WITH
ASSIGNMENT
EXPRESSIONS
..............
89
6
FILES
9I
6.1
DATA
STREAMS
.....................................
91
6.2
READING
DATA
FROM
A
FILE
...............................................................................
92
6.2.1
OPENING
AND
CLOSING
A
FILE
....................................................................
92
6.2.2
THE
WITH
STATEMENT
...............................................................................
93
6.2.3
READING
THE
FILE
CONTENT
.......................................................................
94
6.3
WRITING
DATA
TO
A
FILE
....................................................................................
96
6.4
GENERATING
THE
FILE
OBJECT
...........................................................................
97
6.4.1
THE
BUILT-IN
OPEN
FUNCTION
....................................................................
97
6.4.2
ATTRIBUTES
AND
METHODS
OF
A
FILE
OBJECT
................................................
99
6.4.3
CHANGING
THE
WRITE/READ
POSITION
.......................................................
100
7
THE
DATA
MODEL
103
7.1
THE
STRUCTURE
OF
INSTANCES
............................................................................
105
7.1.1
DATA
TYPE
................................................................................................
106
7.1.2
VALUE
.......................................................................................................
107
7.1.3
IDENTITY
....................................................................................................
108
7.2
DELETING
REFERENCES
......................................................................................
109
7.3
MUTABLE
VERSUS
IMMUTABLE
DATA
TYPES
.......................................................
ILL
8
FUNCTIONS,
METHODS,
AND
ATTRIBUTES
115
MAM=N=MA========S===*********=S*==*TYYRRSCOROS
8.1
PARAMETERS
OF
FUNCTIONS
AND
METHODS
........................................................
115
8.1.1
POSITIONAL
PARAMETERS
............................................................................
116
8.1.2
KEYWORD
ARGUMENTS
...............................................................................
116
8.1.3
OPTIONAL
PARAMETERS
..............................................................................
117
8.1.4
KEYWORD-ONLY
PARAMETERS
.....................................................................
117
8.2
ATTRIBUTES
......................................................................................................
118
9
SOURCES
OF
INFORMATION
ON
PYTHON
119
9.1
THE
BUILT-IN
HELP
FUNCTION
.............................................................................
119
9.2
THE
ONLINE
DOCUMENTATION
............................................................................
120
9.3
PEPS
.................................................................................................................
120
PART
II
DATA
TYPES
10
BASIC
DATA
TYPES:
AN
OVERVIEW
125
10.1
NOTHINGNESS:
NONETYPE
..............................................................................
126
10.2
OPERATORS
....................................................................................................
127
10.2.1
OPERATOR
PRECEDENCE
.............................................................................
127
10.2.2
EVALUATION
ORDER
....................................................................................
129
10.2.3
CONCATENATING
COMPARISONS
.................................................................
129
11
NUMERIC
DATA
TYPES
131
11.1
ARITHMETIC
OPERATORS
..................................................................................
131
11.2
COMPARISON
OPERATORS
................................................................................
133
11.3
CONVERSION
BETWEEN
NUMERIC
DATA
TYPES
.................................................
134
11.4
INTEGERS:
INT
.................................................................................................
135
11.4.1
NUMERAL
SYSTEMS
..................................................................................
135
11.4.2
BIT
OPERATIONS
.......................................................................................
137
11.4.3
METHODS
................................................................................................
141
11.5
FLOATS:
FLOAT
..................................................................................................
141
11.5.1
EXPONENTIAL
NOTATION
............................................................................
142
11.5.2
PRECISION
................................................................................................
142
11.5.3
INFINITE
AND
NOT
A
NUMBER
...................................................................
143
11.6
BOOLEAN
VALUES:
BOOL
...................................................................................
144
11.6.1
LOGICAL
OPERATORS
...................................................................................
144
11.6.2
TRUTH
VALUES
OF
NON-BOOLEAN
DATA
TYPES
............................................
146
11.6.3
EVALUATING
LOGICAL
OPERATORS
................................................................
148
11.7
COMPLEX
NUMBERS:
COMPLEX
.......................................................................
149
12
SEQUENTIAL
DATA
TYPES
153
12.1
THE
DIFFERENCE
BETWEEN
TEXT
AND
BINARY
DATA
...........................................
153
12.2
OPERATIONS
ON
INSTANCES
OF
SEQUENTIAL
DATA
TYPES
....................................
154
12.2.1
CHECKING
FOR
ELEMENTS
..........................................................................
155
12.2.2
CONCATENATION
.......................................................................................
157
12.2.3
REPETITION
................................................................................................
158
12.2.4
INDEXING
..................................................................................................
159
12.2.5
SLICING
......................................................................................................
160
12.2.6
LENGTH
OF
A
SEQUENCE
.............................................................................
164
12.2.7
THE
SMALLEST
AND
THE
LARGEST
ELEMENT
..................................................
164
12.2.8
SEARCHINGFOR
AN
ELEMENT
.......................................................................
165
12.2.9
COUNTING
ELEMENTS
.................................................................................
166
12.3
THE
LIST
DATA
TYPE
.....................
166
12.3.1
CHANGING
A
VALUE
WITHIN
THE
LIST:
ASSIGNMENT
VIA
[]
............................
167
12.3.2
REPLACING
SUBLISTS
AND
INSERTING
NEW
ELEMENTS:
ASSIGNMENT
VIA
[]
.....
167
12.3.3
DELETING
ELEMENTS
AND
SUBLISTS:
DEL
IN
COMBINATION
WITH
[]
................
168
12.3.4
METHODS
OF
LIST
INSTANCES
.......................................................................
169
12.3.5
SORTING
LISTS:
S.SORT([KEY,
REVERSE])
.........................................................
171
12.3.6
SIDE
EFFECTS
.............................................................................................
174
12.3.7
LIST
COMPREHENSIONS
.............................................................................
177
12.4 IMMUTABLE
LISTS:
TUPLE
................................................................................
179
12.4.1
PACKING
AND
UNPACKING
..........................................................................
179
12.4.2
IMMUTABLE
DOESN
T
NECESSARILY
MEAN
UNCHANGEABLE!
.........................
181
12.5
STRINGS:
STR,
BYTES,
BYTEARRAY
........................................................................
182
12.5.1
CONTROL
CHARACTERS
................................................................................
185
12.5.2
STRING
METHODS
......................................................................................
187
12.5.3
FORMATTING
STRINGS
................................................................................
196
12.5.4
CHARACTER
SETS
AND
SPECIAL
CHARACTERS
.................................................
207
13
MAPPINGS
AND
SETS
215
============***************=*******
13.1
DICTIONARY:
DIET
..............................................................................................
215
13.1.1
CREATING
A
DICTIONARY
............................................................................
215
13.1.2
KEYS
AND
VALUES
.....................................................................................
216
13.1.3
ITERATION
.................................................................................................
218
13.1.4
OPERATORS
..............................................................................................
219
13.1.5
METHODS
................................................................................................
221
13.1.6
DIET
COMPREHENSIONS
............................................................................
227
13.2
SETS:
SET
AND
FROZENSET
..................................................................................
227
13.2.1
CREATING
A
SET
........................................................................................
228
13.2.2
ITERATION
.................................................................................................
229
13.2.3
OPERATORS
...............................................................................................
230
13.2.4
METHODS
................................................................................................
235
13.2.5
MUTABLE
SETS:
SET
...................................................................................
236
13.2.6
IMMUTABLE
SETS:
FROZENSET
....................................................................
237
14
COLLECTIONS
239
14.1
CHAINED
DICTIONARIES
...................................................................................
239
14.2
COUNTING
FREQUENCIES
..................................................................................
240
14.3
DICTIONARIES
WITH
DEFAULT
VALUES
................................................................
242
14.4
DOUBLY
LINKED
LISTS
......................................................................................
243
14.5
NAMED
TUPLES
..............................................................................................
245
15
DATE
AND
TIME
247
15.1
ELEMENTARY
TIME
FUNCTIONS
-
TIME
..............................................................
247
15.1.1
THE
STRUCT_TIME
DATA
TYPE
....................................................................
248
15.1.2
CONSTANTS
................................................................................................
249
15.1.3
FUNCTIONS
.................................................................................................
250
15.2
OBJECT-ORIENTED
DATE
MANAGEMENT:
DATETIME
...........................................
254
15.2.1
DATETIME.DATE
.........................................................................................
255
15.2.2
DATETIME.TIME
.........................................................................................
256
15.2.3
DATETIME.DATETIME
.................................................................................
257
15.2.4
DATETIME.TIMEDELTA
................................................................................
259
15.2.5
OPERATIONS
FOR
DATETIME.DATETIME
AND
DATETIME.DATE
.........................
262
15.3
TIME
ZONES:
ZONEINFO
...................................................................................
263
15.3.1
THE
IANA
TIME
ZONE
DATABASE
..............................................................
263
15.3.2
SPECIFYING
THE
TIME
IN
LOCAL
TIME
ZONES
................................................
265
15.3.3
CALCULATING
WITH
TIME
INDICATIONS
IN
LOCAL
TIME
ZONES
........................
265
16
ENUMERATIONS
AND
FLAGS
269
16.1
ENUMERATION
TYPES:
ENUM
...........................................................................
269
16.2
ENUMERATION
TYPES
FOR
BIT
PATTERNS:
FLAG
....................................................
271
16.3
INTEGER
ENUMERATION
TYPES:
INTENUM
.........................................................
272
PART
III
ADVANCED
PROGRAMMING
TECHNIQUES
17
FUNCTIONS
277
==========================================================================================
17.1
DEFINING
A
FUNCTION
.....................................................................................
278
17.2
RETURN
VALUES
...............................................................................................
280
17.3
FUNCTION
OBJECTS
..........................................................................................
282
17.4
OPTIONAL
PARAMETERS
....................................................................................
282
17.5
KEYWORD
ARGUMENTS
....................................................................................
283
17.6 ARBITRARILY
MANY PARAMETERS
.......................................................................
284
17.7
KEYWORD-ONLY
PARAMETERS
...........................................................................
286
17.8
POSITIONAL-ONLY
PARAMETERS
.........................................................................
287
17.9
UNPACKING
WHEN
CALLING
A
FUNCTION
............................................................
288
17.10
SIDE
EFFECTS
...................................................................................................
290
17.11
NAMESPACES
.................................................................
293
17.11.1
ACCESSING
GLOBAL
VARIABLES:
GLOBAL
.....................................................
293
17.11.2
ACCESSING
THE
GLOBAL
NAMESPACE
.......................................................
294
17.11.3
LOCAL
FUNCTIONS
....................................................................................
295
17.11.4
ACCESSING
PARENT
NAMESPACES:
NONLOCAL
...........................................
296
17.11.5
UNBOUND
LOCAL
VARIABLES:
A
STUMBLING
BLOCK
...................................
297
17.12
ANONYMOUS
FUNCTIONS..................................................................................
299
17.13
RECURSION
.......................................................................................................
300
17.14
BUILT-IN
FUNCTIONS
.........................................................................................
300
17.14.1
ABS(X)
..................................................................................................
304
17.14.2
ALL(ITERABLE)
.........................................................................................
304
17.14.3
ANY(ITERABLE)
.......................................................................................
305
17.14.4
ASCII(OBJECT)
.........................................................................................
305
17.14.5
BIN(X)
...................................................................................................
305
17.14.6
BOOL([X])
...............................................................................................
306
17.14.7
BYTEARRAY([SOURCE,
ENCODING,
ERRORS])
................................................
306
17.14.8
BYTES([SOURCE,
ENCODING,
ERRORS])
.......................................................
307
17.14.9
CHR(I)
...................................................................................................
307
17.14.10
COMPLEX([REAL,
IMAG])
.........................................................................
307
17.14.11
DICT([SOURCE])
......................................................................................
308
17.14.12
DIVMOD(A,
B)
........................................................................................
309
17.14.13
ENUMERATE(ITERABLE,
[START])
..............................................................
309
17.14.14
EVAL(EXPRESSION,
[GLOBALS,
LOCALS])
......................................................
309
17.14.15
EXEC(OBJECT,
[GLOBALS,
LOCALS])
.............................................................
310
17.14.16
FILTER(FUNCTION,
ITERABLE)
.....................................................................
310
17.14.17
FLOAT([X])
.............................................................................................
311
17.14.18
FORMAT(VALUE,
[FORMAT_SPEC])
............................................................
311
17.14.19
FROZENSET([ITERABLE])
...........................................................................
311
17.14.20
GLOBALS()
..............................................................................................
312
17.14.21
HASH(OBJECT)
........................................................................................
312
17.14.22
HELP([OBJECT])
......................................................................................
313
17.14.23
HEX(X)
.........................................................
313
17.14.24
ID(OBJECT)
.............................................................................................
313
17.14.25
INPUT([PROMPT])
..................................................................................
314
17.14.26
INT([X,
BASE])
........................................................................................
314
17.14.27
LEN(S)
..................................................................................................
315
17.14.28
LIST([SEQUENCE])
..................................................................................
315
17.14.29
LOCALS()
................................................................................................
315
17.14.30
MAP(FUNCTION,
[*ITERABLE])
..................................................................
316
17.14.31
MAX(ITERABLE,
{DEFAULT,
KEY}),
MAX(ARGL,
ARG2,
[*ARGS],
{KEY})
...........
317
17.14.32
MIN(ITERABLE,
{DEFAULT,
KEY}),
MIN(ARGL,
ARG2,
[*ARGS],
{KEY})
.............
318
17.14.33
OCT(X)
..................................................................................................
318
17.14.34
ORD(C)
..................................................................................................
318
17.14.35
POW(X,Y,[Z])
.......................................................................................
318
17.14.36
PRINT([*OBJECTS],
{SEP,
END,
FILE,
FLUSH})
...............................................
318
17.14.37
RANGE([START],
STOP,
[STEP])
..................................................................
319
17.14.38
REPR(OBJECT)
........................................................................................
320
17.14.39
REVERSED(SEQUENCE)
............................................................................
320
17.14.40
ROUND(X,
[N])
........................................................................................
321
17.14.41
SET([ITERABLE])
.....................................................................................
321
17.14.42
SORTED(ITERABLE,
[KEY,
REVERSE])
...........................................................
321
17.14.43
STR([OBJECT,
ENCODING,
ERRORS])
............................................................
322
17.14.44
SUM(ITERABLE,
[START])
.........................................................................
323
17.14.45
TUPLE([ITERABLE])
.................................................................................
323
17.14.46
TYPE(OBJECT)
........................................................................................
323
17.14.47
ZIP([*ITERABLES],
{STRICT})
......................................................................
324
18
MODULES
AND
PACKAGES
325
18.1
IMPORTING
GLOBAL
MODULES
..........................................................................
326
18.2
LOCAL
MODULES
..............................................................................................
328
18.2.1
NAME
CONFLICTS
...................................................................................
329
18.2.2
MODULE-INTERNAL
REFERENCES
..............................................................
330
18.2.3
EXECUTING
MODULES
............................................................................
330
18.3
PACKAGES
......................................................................................................
331
18.3.1
IMPORTING
ALL
MODULES
OF
A
PACKAGE
.................................................
333
18.3.2
NAMESPACE
PACKAGES
.........................................................................
333
18.3.3
RELATIVE
IMPORT
STATEMENTS
...............................................................
334
18.4
THE
IMPORTLIB
PACKAGE
.................................................................................
335
18.4.1
IMPORTING
MODULES
AND
PACKAGES
.....................................................
335
18.4.2
CHANGING
THE
IMPORT
BEHAVIOR
..........................................................
335
18.5
PLANNED
LANGUAGE
ELEMENTS
.......................................................................
338
19
OBJECT-ORIENTED
PROGRAMMING
341
19.1
EXAMPLE:
A
NON-OBJECT-ORIENTED
ACCOUNT
.................................................
341
19.1.1
CREATING
A
NEW
ACCOUNT
........................................................................
342
19.1.2
TRANSFERRING
MONEY
..............................................................................
342
19.1.3
DEPOSITING
AND
WITHDRAWING
MONEY
..................................................
343
19.1.4
VIEWING
THE
ACCOUNT
BALANCE
..............................................................
344
19.2
CLASSES
..........................................................................................................
346
19.2.1
DEFINING
METHODS
................................................................................
347
19.2.2
THE
CONSTRUCTOR
....................................................................................
348
19.2.3
ATTRIBUTES
..............................................................................................
349
19.2.4
EXAMPLE:
AN
OBJECT-ORIENTED
ACCOUNT
................................................
349
19.3
INHERITANCE
...................................................................................................
351
19.3.1
A
SIMPLE
EXAMPLE
.................................................................................
352
19.3.2
OVERRIDING
METHODS
.............................................................................
353
19.3.3
EXAMPLE:
CHECKING
ACCOUNT
WITH
DAILY
TURNOVER
...............................
355
19.3.4
OUTLOOK
..................................................................................................
363
19.4
MULTIPLE
INHERITANCE
...................................................................................
363
19.5
PROPERTY
ATTRIBUTES
......................................................................................
365
19.5.1
SETTERS
AND
GETTERS
................................................................................
365
19.5.2
DEFINING
PROPERTY
ATTRIBUTES
.................................................................
366
19.6
STATIC
METHODS
.............................................................................................
367
19.7
CLASS
METHODS
..............................................................................................
369
19.8
CLASS
ATTRIBUTES
...........................................................................................
370
19.9
BUILT-IN
FUNCTIONS
FOR
OBJECT-ORIENTED
PROGRAMMING
...............................
370
19.9.1
FUNCTIONSFOR
MANAGING
THE
ATTRIBUTES
OF
AN
INSTANCE
......................
371
19.9.2
FUNCTIONS
FOR
INFORMATION
ABOUT
THE
CLASS
HIERARCHY
.........................
372
19.10
INHERITING
BUILT-IN
DATA
TYPES
.....................................................................
373
19.11
MAGIC
METHODS
AND
MAGIC
ATTRIBUTES
........................................................
375
19.11.1
GENERAL
MAGIC
METHODS
........................................................................
375
19.11.2
OVERLOADING
OPERATORS
..........................................................................
382
19.11.3
EMULATING
DATA
TYPES:
DUCK
TYPING
.....................................................
388
19.12
DATA
CLASSES
.................................................................................................
393
19.12.1
TUPLESAND
LISTS
....................................................................................
393
19.12.2
DICTIONARIES
..........................................................................................
394
19.12.3
NAMED
TUPLES
.......................................................................................
394
19.12.4
MUTABLE
DATA
CLASSES
..........................................................................
395
19.12.5
IMMUTABLE
DATA
CLASSES
.......................................................................
396
19.12.6
DEFAULT
VALUES
IN
DATA
CLASSES
.............................................................
396
20
EXCEPTION
HANDLING
399
====================
20.1
EXCEPTIONS
....................................................................................................
399
20.1.1
BUILT-IN
EXCEPTIONS
.................................................................................
400
20.1.2
RAISING
AN
EXCEPTION
..............................................................................
401
20.1.3
HANDLING
AN
EXCEPTION
..........................................................................
401
20.1.4
CUSTOM
EXCEPTIONS
................................................................................
406
20.1.5
RE-RAISING
AN
EXCEPTION
.........................................................................
408
20.1.6
EXCEPTION
CHAINING
................................................................................
410
20.2
ASSERTIONS
.....................................................................................................
411
20.3
WARNINGS
......................................................................................................
412
21
GENERATORS
AND
ITERATORS
415
21.1
GENERATORS
...................................................................................................
415
21.1.1
SUBGENERATORS
........................................................................................
418
21.1.2
GENERATOR
EXPRESSIONS
...........................................................................
421
21.2
ITERATORS
.......................................................................................................
422
21.2.1
THE
ITERATOR
PROTOCOL
..............................................................................
422
21.2.2
EXAMPLE:
THE
FIBONACCI
SEQUENCE
.........................................................
423
21.2.3
EXAMPLE:
THE
GOLDEN
RATIO
....................................................................
424
21.2.4
A
GENERATOR
FOR
THE
IMPLEMENTATION
OF
__
ITER
.....................................
424
21.2.5
USING
ITERATORS
........................................................................................
425
21.2.6
MULTIPLE
ITERATORS
FOR
THE
SAME
INSTANCE
..............................................
428
21.2.7
DISADVANTAGES
OF
ITERATORS
COMPARED
TO
DIRECT
ACCESS
VIA
INDEXES
....
430
21.2.8
ALTERNATIVE
DEFINITION
FOR
ITERABLE
OBJECTS
............................................
430
21.2.9
FUNCTION
ITERATORS
...................................................................................
431
21.3
SPECIAL
GENERATORS:
ITERTOOLS
.......................................................................
432
21.3.1
ACCUMULATE(ITERABLE,
[FUNC])
..................................................................
433
21.3.2
CHAIN([*ITERA
BLES])
...................................................................................
433
21.3.3
COMBINATIONS(ITERABLE,
R)
.......................................................................
434
21.3.4
COMBINATIONS_WITH_REPLACEMENT(ITERABLE,
R)
.......................................
434
21.3.5
COMPRESS(DATA,
SELECTORS)
......................................................................
435
21.3.6
COUNT([START,
STEP])
.................................................................................
435
21.3.7
CYCLE(ITERABLE)
.......................................................................................
436
21.3.8
DROPWHILE(PREDICATE,
ITERABLE)
.............................................................
436
21.3.9
FILTERFALSE(PREDICATE,
ITERABLE)
..............................................................
436
21.3.10
GROUPBY(ITERABLE,
[KEY])
........................................................................
437
21.3.11
ISLICE(ITERABLE,
[START],
STOP,
[STEP])
........................................................
437
21.3.12
PERMUTATIONS(ITERABLE,
[R])
...................................................................
438
21.3.13
PRODUCT([*ITERABLES],
[REPEAT])
..............................................................
438
21.3.14
REPEAT(OBJECT,
[TIMES])
..........................................................................
439
21.3.15
STARMAP(FUNCTION,
ITERABLE)
..................................................................
439
21.3.16
TAKEWHILE(PREDICATE,
ITERABLE)
..............................................................
439
21.3.17
TEE(ITERABLE,
[N])
....................................................................................
439
21.3.18
ZIP_LONGEST([*ITERABLES],
{FILLVALUE})
......................................................
440
22
CONTEXT
MANAGER
441
22.1
THE
WITH
STATEMENT
.....................................................................................
441
22.1.1
__ENTER_JSELF)
......................................................................................
443
22.1.2
__
EXIT
__
(SELF,
EXC_TYPE,
EXC_VALUE,
TRACEBACK)
....................................
444
22.2
HELPER
FUNCTIONS
FOR
WITH
CONTEXTS:
CONTEXTLIB
..........................................
444
22.2.1
DYNAMICALLY
ASSEMBLED
CONTEXT
COMBINATIONS
-
EXITSTACK
...............
444
22.2.2
SUPPRESSING
CERTAIN
EXCEPTION
TYPES
...................................................
445
22.2.3
REDIRECTING
THE
STANDARD
OUTPUT
STREAM
.............................................
445
22.2.4
OPTIONAL
CONTEXTS
..................................................................................
446
22.2.5
SIMPLE
FUNCTIONS
AS
CONTEXT
MANAGER
..................................................
447
23
DECORATORS
449
23.1
FUNCTION
DECORATORS
.....................................................................................
449
23.1.1
DECORATING
FUNCTIONS
AND
METHODS
.....................................................
451
23.1.2
NAME
AND
DOCSTRING
AFTER
APPLYING
A
DECORATOR
.................................
451
23.1.3
NESTED
DECORATORS
.................................................................................
452
23.1.4
EXAMPLE:
A
CACHE
DECORATOR
................................................................
452
23.2
CLASS
DECORATORS
...........................................................................................
454
23.3 THEFUNCTOOLS
MODULE
..................................................................................
455
23.3.1
SIMPLIFYING
FUNCTION
INTERFACES
............................................................
455
23.3.2
SIMPLIFYING
METHOD
INTERFACES
.............................................................
457
23.3.3
CACHES
...................................................................................................
457
23.3.4
COMPLETINGORDERINGSOF
CUSTOM
CLASSES
...........................................
459
23.3.5
OVERLOADING
FUNCTIONS
..........................................................................
459
24
ANNOTATIONS
FOR
STATIC
TYPE
CHECKING
463
24.1
ANNOTATIONS
................................................................................................
464
24.1.1
ANNOTATING
FUNCTIONS
AND
METHODS
.....................................................
465
24.1.2
ANNOTATING
VARIABLES
AND
ATTRIBUTES
...................................................
466
24.1.3
ACCESSING
ANNOTATIONS
AT
RUNTIME
.......................................................
468
24.1.4
WHEN
ARE
ANNOTATIONS
EVALUATED?
........................................................
470
24.2
TYPE
HINTS:
THE
TYPING
MODULE
..................................................................
471
24.2.1
VALID
TYPE
HINTS
....................................................................................
472
24.2.2
CONTAINER
TYPES
....................................................................................
472
24.2.3
ABSTRACT
CONTAINER
TYPES
.....................................................................
473
24.2.4
TYPE
ALIASES
...........................................................................................
474
24.2.5
TYPE
UNIONS
AND
OPTIONAL
VALUES
........................................................
474
24.2.6
TYPE
VARIABLES
.......................................................................................
475
24.3
STATIC
TYPE
CHECKING
IN
PYTHON:
MYPY
.......................................................
476
24.3.1
INSTALLATION
.............................................................................................
476
24.3.2
EXAMPLE
.................................................................................................
477
25
STRUCTURAL
PATTERN
MATCHING
479
25.1
THE
MATCH
STATEMENT
.................................................................................
479
25.2
PATTERN
TYPES
IN
THE
CASE
STATEMENT
..........................................................
480
25.2.1
LITERAL
AND
VALUE
PATTERNS
......................................................................
481
25.2.2
OR
PATTERN
...............................................................................................
481
25.2.3
PATTERNS
WITH
TYPE
CHECKING
.................................................................
482
25.2.4
SPECIFYING
CONDITIONS
FOR
MATCHES
.......................................................
483
25.2.5
GROUPING
SUBPATTERNS
...........................................................................
483
25.2.6
CAPTURE
AND
WILDCARD
PATTERNS
.............................................................
484
25.2.7
SEQUENCE
PATTERNS
.................................................................................
486
25.2.8
MAPPING
PATTERNS
...................................................................................
488
25.2.9
PATTERNS
FOR
OBJECTS
AND
THEIR
ATTRIBUTE
VALUES
...................................
490
PART
IV
THE
STANDARD
LIBRARY
26
MATHEMATICS
497
*=MS=MM====A====***S******=***********ESROGYESYLN*
26.1
MATHEMATICAL
FUNCTIONS:
MATH,
CMATH
......................................................
497
26.1.1
GENERAL
MATHEMATICAL
FUNCTIONS
.........................................................
498
26.1.2
EXPONENTIAL
AND
LOGARITHM
FUNCTIONS
...................................................
501
26.1.3
TRIGONOMETRIC
AND
HYPERBOLIC
FUNCTIONS
..............................................
501
26.1.4
DISTANCES
AND
NORMS
..............................................................................
502
26.1.5
CONVERTING
ANGLES
...................................................................................
502
26.1.6
REPRESENTATIONS
OF
COMPLEX
NUMBERS
..................................................
502
26.2
RANDOM
NUMBER
GENERATOR:
RANDOM
.........................................................
503
26.2.1
SAVING
AND
LOADING
THE
RANDOM
STATE
..................................................
504
26.2.2
GENERATING
RANDOM
INTEGERS
.................................................................
504
26.2.3
GENERATING
RANDOM
FLOATS
....................................................................
505
26.2.4
RANDOM
OPERATIONS
ON
SEQUENCES
........................................................
505
26.2.5
SYSTEMRANDOM([SEED])
..........................................................................
507
26.3
STATISTICAL
CALCULATIONS:
STATISTICS
...............................................................
507
26.4
INTUITIVE
DECIMAL
NUMBERS:
DECIMAL
..........................................................
509
26.4.1
USING
THE
DATA
TYPE
...............................................................................
509
26.4.2
NONNUMERIC
VALUES
................................................................................
512
26.4.3
THE
CONTEXT
OBJECT
.................................................................................
513
26.5
HASH
FUNCTIONS:
HASHLIB
..............................................................................
514
26.5.1
USING
THE
MODULE
....................................................................................
516
26.5.2
OTHER
HASH
ALGORITHMS
..........................................................................
517
26.5.3
COMPARING
LARGE
FILES
...........................................................
517
26.5.4
PASSWORDS
...............................................................................................
518
27
SCREEN
OUTPUTS
AND
LOGGING
521
27.1
FORMATTED
OUTPUT
OF
COMPLEX
OBJECTS:
PPRINT
..........................................
521
27.2
LOG
FILES:
LOGGING
.........................................................................................
523
27.2.1
CUSTOMIZING
THE
MESSAGE
FORMAT
.........................................................
525
27.2.2
LOGGING
HANDLERS
....................................................................................
527
28
REGULAR
EXPRESSIONS
529
28.1
SYNTAX
OF
REGULAR
EXPRESSIONS
.....................................................................
529
28.1.1
ANY
CHARACTER
.........................................................................................
530
28.1.2
CHARACTER
CLASSES
...................................................................................
530
28.1.3
QUANTIFIERS
..............................................................................................
531
28.1.4
PREDEFINED
CHARACTER
CLASSES
.................................................................
533
28.1.5
OTHER
SPECIAL
CHARACTERS
.......................................................................
534
28.1.6
NONGREEDY
QUANTIFIERS
...........................................................................
535
28.1.7
GROUPS
.....................................................................................................
536
28.1.8
ALTERNATIVES
............................................................................................
536
28.1.9
EXTENSIONS
...............................................................................................
537
28.2
USING
THE
RE
MODULE
.....................................................................................
539
28.2.1
SEARCHING
................................................................................................
540
28.2.2
MATCHING
.................................................................................................
540
28.2.3
SPLITTING
A
STRING
.....................................................................................
541
28.2.4
REPLACING
PARTS
OF
A
STRING
.....................................................................
541
28.2.5
REPLACING
PROBLEM
CHARACTERS
...............................................................
542
28.2.6
COMPILING
A
REGULAR
EXPRESSION
............................................................
542
28.2.7
FLAGS
........................................................................................................
543
28.2.8
THE
MATCH
OBJECT
...................................................................................
544
28.3
A
SIMPLE
SAMPLE
PROGRAM:
SEARCHING
........................................................
546
28.4
A
MORE
COMPLEX
SAMPLE
PROGRAM:
MATCHING
............................................
547
28.5
COMMENTS
IN
REGULAR
EXPRESSIONS
..............................................................
550
29
INTERFACE
TO
OPERATING
SYSTEM
AND
RUNTIME
ENVIRONMENT
553
29.1
OPERATING
SYSTEM
FUNCTIONALITY:
OS
.............................................................
553
29.1.1
ENVIRON
...................................................................................................
554
29.1.2
GETPID()
...................................................................................................
554
29.1.3
CPU_COUNT()
............................................................................................
554
29.1.4
SYSTEM(CMD)
...........................................................................................
554
29.1.5
POPEN(COMMAND,
[MODE,
BUFFERING])
....................................................
555
29.2
ACCESSING
THE
RUNTIME
ENVIRONMENT:
SYS
...................................................
555
29.2.1
COMMAND
LINE
PARAMETERS
....................................................................
556
29.2.2
DEFAULT
PATHS
..........................................................................................
556
29.2.3
STANDARD
INPUT/OUTPUT
STREAMS
...........................................................
556
29.2.4
EXITING
THE
PROGRAM
................................................................................
556
29.2.5
DETAILS
OF
THE
PYTHON
VERSION
.................................................................
557
29.2.6
OPERATING
SYSTEM
DETAILS
.......................................................................
557
29.2.7
HOOKS
.......................................................................................................
559
29.3
COMMAND
LINE
PARAMETERS:
ARGPARSE
..........................................................
561
29.3.1
CALCULATOR:
A
SIMPLE
EXAMPLE
................................................................
562
29.3.2
A
MORE
COMPLEX
EXAMPLE
......................................................................
566
30
FILE
SYSTEM
569
30.1
ACCESSING
THE
FILE
SYSTEM:
OS
.......................................................................
569
30.1.1
ACCESS(PATH,
MODE)
.................................................................................
570
30.1.2
CHMOD(PATH,
MODE)
................................................................................
571
30.1.3
LISTDIR([PATH])
...........................................................................................
571
30.1.4
MKDIR(PATH,
[MODE])
AND
MAKEDIRS(PATH,
[MODE])
................................
572
30.1.5
REMOVE(PATH)
..........................................................................................
572
30.1.6
REMOVEDIRS(PATH)
....................................................................................
572
30.1.7
RENAME(SRC,
DST)
AND
RENAMES(OLD,
NEW)
.................................................
573
30.1.8
WALK(TOP,
[TOPDOWN,
ONERROR])
.................................................................
573
30.2
FILE
PATHS:
OS.PATH
........................................................................................
575
30.2.1
ABSPATH(PATH)
.........................................................................................
576
30.2.2
BASENAME(PATH)
......................................................................................
577
30.2.3
COMMONPREFIX(LIST)
.................................................................................
577
30.2.4
DIRNAME(PATH)
........................................................................................
577
30.2.5
JOIN(PATH,
*PATHS)
....................................................................................
578
30.2.6
NORMCASE(PATH)
.......................................................................................
578
30.2.7
SPLIT(PATH)
................................................................................................
578
30.2.8
SPLITDRIVE(PATH)
.......................................................................................
579
30.2.9
SPLITEXT(PATH)
..........................................................................................
579
30.3
ACCESSING
THE
FILE
SYSTEM:
SHUTIL
..................................................................
579
30.3.1
DIRECTORY
AND
FILE
OPERATIONS
................................................................
581
30.3.2
ARCHIVE
OPERATIONS
.................................................................................
582
30.4
TEMPORARY
FILES:
TEMPFILE
............................................................................
585
30.4.1
TEMPORARYFILE([MODE,
[BUFSIZE,
SUFFIX,
PREFIX,
DIR])
................................
585
30.4.2
TEMPFILE.TEMPORARYDIRECTORY([SUFFIX,
PREFIX,
DIR])
................................
586
31
PARALLEL
PROGRAMMING
587
31.1
PROCESSES,
MULTITASKING,
AND
THREADS
........................................................
587
31.1.1
THE
LIGHTWEIGHTS
AMONG
THE
PROCESSES:
THREADS
.................................
588
31.1.2
THREADS
OR
PROCESSES?
............................................................................
590
31.1.3
COOPERATIVE
MULTITASKING:
A
THIRD
WAY
................................................
590
31.2
PYTHON
S
INTERFACES
FOR
PARALLELIZATION
.......................................................
591
31.3
THE
ABSTRACT
INTERFACE:
CONCURRENT.FUTURES
...............................................
592
31.3.1
AN
EXAMPLE
WITH
A
FUTURES.THREADPOOLEXECUTOR
..................................
593
31.3.2
EXECUTOR
INSTANCES
AS
CONTEXT
MANAGERS
.............................................
595
31.3.3
USING
FUTURES.PROCESSPOOLEXECUTOR
.......................................................
595
31.3.4
MANAGING
THE
TASKS
OF
AN
EXECUTOR
......................................................
596
31.4
THE
FLEXIBLE
INTERFACE:
THREADING
AND
MULTIPROCESSING
.............................
602
31.4.1
THREADS
IN
PYTHON:
THREADING
................................................................
603
31.4.2
PROCESSES
IN
PYTHON:
MULTIPROCESSING
...................................................
611
31.5
COOPERATIVE
MULTITASKING
...........................................................................
613
31.5.1
COOPERATIVE
FUNCTIONS:
COROUTINES
.......................................................
613
31.5.2
AWAITABLE
OBJECTS
..................................................................................
614
31.5.3
THE
COOPERATION
OF
COROUTINES:
TASKS
..................................................
615
31.5.4
A
COOPERATIVE WEB
CRAWLER
...................................................................
618
31.5.5
BLOCKING
OPERATIONS
IN
COROUTINES
........................................................
625
31.5.6
OTHER
ASYNCHRONOUS
LANGUAGE
FEATURES
..............................................
627
31.6
CONCLUSION:
WHICH
INTERFACE
IS
THE
RIGHT
ONE?
..........................................
629
31.6.1
IS
COOPERATIVE
MULTITASKING
AN
OPTION?
................................................
629
31.6.2
ABSTRACTION
OR
FLEXIBILITY?
.....................................................................
630
31.6.3
THREADS
OR
PROCESSES?
...........................................................................
630
32
DATA
STORAGE
631
32.1
XML
...............................................................................................................
631
32.1.1
ELEMENTTREE
..........................................................................................
633
32.1.2
SIMPLE
API
FOR
XML
................................................................................
640
32.2
DATABASES......................................................................................................
643
32.2.1
THE
BUILT-IN
DATABASE
IN
PYTHON:
SQLITE3
..............................................
646
32.3
COMPRESSED
FILES
AND
ARCHIVES
....................................................................
661
32.3.1
GZIP.OPEN(FILENAME,
[MODE,
COMPRESSLEVEL])
.......................................
661
32.3.2
OTHER
MODULES
FOR
ACCESSING
COMPRESSED
DATA
.................................
662
32.4
SERIALIZING
INSTANCES:
PICKLE
.........................................................................
662
32.4.1
FUNCTIONAL
INTERFACE
..............................................................................
663
32.4.2
OBJECT-ORIENTED
INTERFACE
.....................................................................
665
32.5
THE
JSON
DATA
EXCHANGE
FORMAT:
JSON
.......................................................
665
32.6
THE
CSV
TABLE
FORMAT:
CSV
...........................................................................
667
32.6.1
READING
DATA
FROM
A
CSV
FILE
WITH
READER
OBJECTS
..............................
668
32.6.2
USING
CUSTOM
DIALECTS:
DIALECT
OBJECTS
...............................................
670
33
NETWORK
COMMUNICATION
673
33.1
SOCKET
API
.....................................................................................................
674
33.1.1
CLIENT-SERVER
SYSTEMS
...........................................................................
675
33.1.2
UDP
........................................................................................................
677
33.1.3
TCP
.........................................................................................................
678
33.1.4
BLOCKING
AND
NONBLOCKING
SOCKETS
.......................................................
680
33.1.5
CREATING
A
SOCKET
...................................................................................
681
33.1.6
THE
SOCKET
CLASS
....................................................................................
682
33.1.7
NETWORK
BYTE
ORDER
...............................................................................
685
33.1.8
MULTIPLEXING
SERVERS:
SELECTORS
............................................................
686
33.1.9
OBJECT-ORIENTED
SERVER
DEVELOPMENT:
SOCKETSERVER
...........................
688
33.2
XML-RPC
.......................................................................................................
690
33.2.1
THESERVER
..............................................................................................
691
33.2.2
THE
CLIENT
...............................................................................................
694
33.2.3
MULTICALL
.................................................................................................
696
33.2.4
LIMITATIONS
.............................................................................................
697
34
ACCESSING
RESOURCES
ON
THE
INTERNET
701
34.1
PROTOCOLS........................................................................................................
701
34.1.1
HYPERTEXT
TRANSFER
PROTOCOL
..................................................................
701
34.1.2
FILE
TRANSFER
PROTOCOL
.............................................................................
701
34.2
SOLUTIONS
........................................................................................................
702
34.2.1
OUTDATED
SOLUTIONS
FOR
PYTHON
2
...........................................................
702
34.2.2
SOLUTIONS
IN
THE
STANDARD
LIBRARY
.........................................................
702
34.2.3
THIRD-PARTY
SOLUTIONS
.............................................................................
702
34.3
THE
EASY
WAY:
REQUESTS
..............................................................................
703
34.3.1
SIMPLE
REQUESTS
VIA
GET
AND
POST.......................................................
703
34.3.2
WEB
APIS
................................................................................................
704
34.4
URLS:
URLLIB
...................................................................................................
705
34.4,1
ACCESSING
REMOTE
RESOURCES:
URLLIB.REQUEST
........................................
706
34.4.2
READING
AND
PROCESSING
URLS:
URLLIB.PARSE
...........................................
710
34.5
FTP:
FTPLIB
....................................................................................................
713
34.5.1
CONNECTING
TO
AN
FTP
SERVER
.................................................................
714
34.5.2
EXECUTING
FTP
COMMANDS
.....................................................................
715
34.5.3
WORKING
WITH
FILES
AND
DIRECTORIES
......................................................
715
34.5.4
TRANSFERRING
FILES
...................................................................................
716
35
EMAIL
721
35.1
SMTP:
SMTPLIB
.............................................................................................
721
35.1.1
SMTP([HOST,
PORT,
LOCAL_HOSTNAME,
TIMEOUT,
SOURCE_ADDRESS])
...........
722
35.1.2
ESTABLISHING
AND
TERMINATING
A
CONNECTION
.........................................
722
35.1.3
SENDING
AN
EMAIL
....................................................................................
723
35.1.4
EXAMPLE
..................................................................................................
724
35.2
POP3:
POPIIB
................................................................................................
724
35.2.1
POP3(HOST,
[PORT,
TIMEOUT])
....................................................................
725
35.2.2
ESTABLISHING
AND
TERMINATING
A
CONNECTION
.........................................
725
35.2.3
LISTING
EXISTING
EMAILS
...........................................................................
726
35.2.4
RETRIEVING
AND
DELETING
EMAILS
...................................................
727
35.2.5
EXAMPLE
..................................................................................................
727
35.3
IMAP4:
IMAPLIB
.............................................................................................
728
35.3.1
IMAP4([HOST,
PORT,TIMEOUT])
.................................................................
729
35.3.2
ESTABLISHING
AND
TERMINATING
A
CONNECTION
.........................................
730
35.3.3
FINDING
AND
SELECTING
A
MAILBOX
............................................................
730
35.3.4
OPERATIONS
WITH
MAILBOXES
...................................................................
731
35.3.5
SEARCHING
EMAILS
....................................................................................
731
35.3.6
RETRIEVING
EMAILS
....................................................................................
732
35.3.7
EXAMPLE
..................................................................................................
733
35.4
CREATING
COMPLEX
EMAILS:
EMAIL
.................................................................
734
35.4.1
CREATING
A
SIMPLE
EMAIL
.........................................................................
734
35.4.2
CREATING
AN
EMAIL
WITH
ATTACHMENTS
....................................................
735
35.4.3
READING
AN
EMAIL
....................................................................................
737
36
DEBUGGING
AND
QUALITY
ASSURANCE
739
MMM==SA=M==M===**S***S=*****S==*==*SENOS
36.1
THE
DEBUGGER
..............................................................................................
739
36.2
AUTOMATED
TESTING
.....................................................................................
741
36.2.1
TEST
CASES
IN
DOCSTRINGS:
DOCTEST
.........................................................
742
36.2.2
UNIT
TESTS:
UNITTEST
................................................................................
746
36.3
ANALYZING
THE
RUNTIME
PERFORMANCE
..........................................................
749
36.3.1
RUNTIME
MEASUREMENT:
TIMEIT
.............................................................
749
36.3.2
PROFILING:
CPROFILE
...................................................................................
752
36.3.3
TRACING:
TRACE
........................................................................................
756
37
DOCUMENTATION
759
37.1
DOCSTRINGS
....................................................................................................
759
37.2
AUTOMATICALLY
GENERATED
DOCUMENTATION:
PYDOC
....................................
761
PARTV
ADVANCED
TOPICS
38
DISTRIBUTING
PYTHON
PROJECTS
765
38.1
A
HISTORY
OF
DISTRIBUTIONS
IN
PYTHON
............................................................
765
38.1.1
THE
CLASSIC
APPROACH:
DISTUTILS
.............................................................
766
38.1.2
THE
NEW
STANDARD:
SETUPTOOLS
.............................................................
766
38.1.3
THE
PACKAGE
INDEX:
PYPI
........................................................................
766
38.2
CREATING
DISTRIBUTIONS:
SETUPTOOLS
..............................................................
767
38.2.1
INSTALLATION
..............................................................................................
767
38.2.2
WRITING
THE
MODULE
...............................................................................
767
38.2.3
THE
INSTALLATION
SCRIPT
............................................................................
768
38.2.4
CREATING
A
SOURCE
DISTRIBUTION
..............................................................
773
38.2.5
CREATING
A
BINARY
DISTRIBUTION
...............................................................
773
38.2.6
INSTALLING
DISTRIBUTIONS
...........................................................................
774
38.3
CREATING
EXE
FILES:
CX_FREEZE
.......................................................................
775
38.3.1
INSTALLATION
..............................................................................................
775
38.3.2
USAGE
......................................................................................................
775
38.4
PACKAGE
MANAGER
.......................................................................................
776
38.4.1
THE
PYTHON
PACKAGE
MANAGER:
PIP
.......................................................
777
38.4.2
THE
CONDA
PACKAGE
MANAGER
................................................................
778
38.5
LOCALIZING
PROGRAMS:
GETTEXT
.....................................................................
781
38.5.1
EXAMPLE
OF
USING
GETTEXT
.....................................................................
781
38.5.2
CREATING
THE
LANGUAGE
COMPILATION
.....................................................
783
39
VIRTUAL
ENVIRONMENTS
785
39.1
USING
VIRTUAL
ENVIRONMENTS:
VENV
...............................................................
786
39.1.1
ACTIVATING
A
VIRTUAL
ENVIRONMENT
.........................................................
786
39.1.2
WORKING
IN
A
VIRTUAL
ENVIRONMENT
........................................................
786
39.1.3
DEACTIVATING
A
VIRTUAL
ENVIRONMENT
.....................................................
787
39.2
VIRTUAL
ENVIRONMENTS
IN
ANACONDA
.............................................................
787
40
ALTERNATIVE
INTERPRETERS
AND
COMPILERS
789
40.1
JUST-IN-TIME
COMPILATION:
PYPY
..................................................................
789
40.1.1
INSTALLATION
AND
USE
................................................................................
789
40.1.2
EXAMPLE
..................................................................................................
790
40.2
NUMBA
.........................................................................................................
790
40.2.1
INSTALLATION
..............................................................................................
791
40.2.2
EXAMPLE
...............................................................................
791
40.3
CONNECTING
TO
C
AND
C++:
CYTHON
...............................................................
793
40.3.1
INSTALLATION
..............................................................................................
793
40.3.2
THE
FUNCTIONALITY
OF
CYTHON
..................................................................
794
40.3.3
COMPILING
A
CYTHON
PROGRAM
.................................................................
794
40.3.4
A
CYTHON
PROGRAM
WITH
STATIC
TYPING
...................................................
796
40.3.5
USING
A
C
LIBRARY
.....................................................................................
797
40.4
THE
INTERACTIVE
PYTHON
SHELL:
IPYTHON
........................................................
799
40.4.1
INSTALLATION
..............................................................................................
799
40.4.2
THE
INTERACTIVE
SHELL
...............................................................................
799
40.4.3
THE
JUPYTER
NOTEBOOK
............................................................................
802
41
GRAPHICAL
USER
INTERFACES
805
=MSS=======AAR===============MMNA
A
=*M=MMMAAMAAASASSASANAAAZANAZAANANANANOZAMZZZEANAN
41.1
TOOLKITS
.........................................................................................................
805
41.1.1
TKINTER(TK)
..............................................................................................
805
41.1.2
PYGOBJECT
(GTK)
......................................................................................
806
41.1.3
QT
FOR
PYTHON
(QT)
...................................................................................
806
41.1.4
WXPYTHON
(WXWIDGETS)
..........................................................................
807
41.2
INTRODUCTION
TO
TKINTER
................................................................................
807
41.2.1
A
SIMPLE
EXAMPLE
...................................................................................
807
41.2.2
CONTROL
VARIABLES
....................................................................................
810
41.2.3
THE
PACKER
...............................................................................................
811
41.2.4
EVENTS
......................................................................................................
815
41.2.5
WIDGETS
...................................................................................................
821
41.2.6
DRAWINGS:
THE
CANVAS
WIDGET
...............................................................
839
41.2.7
OTHER
MODULES
.......................................................................................
846
41.3
INTRODUCTION
TO
PYSIDE6
...............................................................................
850
41.3.1
INSTALLATION
..............................................................................................
850
41.3.2
BASIC
CONCEPTS
OF
QT
...............................................................................
850
41.3.3
DEVELOPMENT
PROCESS
..............................................................................
852
41.4
SIGNALS
AND
SLOTS
..........................................................................................
859
41.5
IMPORTANT
WIDGETS
......................................................................................
861
41.5.1
QCHECKBOX
..............................................................................................
862
41.5.2
QCOMBOBOX
............................................................................................
862
41.5.3
QDATEEDIT,
QTIMEEDIT,
AND
QDATETIMEEDIT
..........................................
863
41.5.4
QDIALOG
...................................................................................................
863
41.5.5
QLINEEDIT
.................................................................................................
864
41.5.6
QLISTWIDGET
AND
QLISTVIEW
...................................................................
864
41.5.7
QPROGRESSBAR
...........................................................................................
865
41.5.8
QPUSHBUTTON
...........................................................................................
865
41.5.9
QRADIOBUTTON
.........................................................................................
865
41.5.10
QSLIDER
AND
QDIAL
...................................................................................
866
41.5.11
QTEXTEDIT
................................................................................................
866
41.5.12
QWIDGET
.................................................................................................
867
41.6
DRAWING
FUNCTIONALITY
.................................................................................
868
41.6.1
TOOLS
........................................................................................................
868
41.6.2
COORDINATE
SYSTEM
.................................................................................
870
41.6.3
SIMPLE
SHAPES
........................................................................................
871
41.6.4
IMAGES
.....................................................................................................
873
41.6.5
TEXT
.........................................................................................................
874
41.6.6
EYE
CANDY
................................................................................................
876
41.7
MODEL-VIEW
ARCHITECTURE
.............................................................................
879
41.7.1
SAMPLE
PROJECT:
AN
ADDRESS
BOOK
.........................................................
880
41.7.2
SELECTING
ENTRIES
....................................................................................
888
41.7.3
EDITING
ENTRIES
.......................................................................................
890
42
PYTHON
AS
A
SERVER-SIDE
PROGRAMMING
LANGUAGE
ON
THE
WEB:
AN
INTRODUCTION
TO
DJANGO
893
IAMHMSLRTTMKRMWFTTNFTTTTTTTTLFTYTTTCTTTTRTTCTT TTITTTTTYTTTTTYT TTTTTTTTTTTTYTTTTT TTTTCTTEETTTTTTYTT TTTTTTTYTTTTN
TTTMTTTTTTTTTTTTITYNTTTTTTNTFT
TEFTTFYMUNYHST
OKHTNT
UEWWVUGWNFNWWFYMMWNYWYHNRTH
42.1
CONCEPTS
AND
FEATURES
OF
DJANGO
...............................................................
894
42.2
INSTALLING
DJANGO
..........................................................................................
895
42.3
CREATING
A
NEW
DJANGO
PROJECT
...................................................................
896
42.3.1
THE
DEVELOPMENT
WEB
SERVER
..............................................................
897
42.3.2
CONFIGURING
THE
PROJECT
.........................................................................
898
42.4
CREATING
AN
APPLICATION
...............................................................................
900
42.4.1
IMPORTING
THE
APPLICATION
INTO
THE
PROJECT
............................................
901
42.4.2
DEFINING
A
MODEL
...................................................................................
901
42.4.3
RELATIONSHIPS
BETWEEN
MODELS
............................................................
902
42.4.4
TRANSFERRING
THE
MODEL
TO
THE
DATABASE
...............................................
903
42.4.5
THE
MODEL
API
.........................................................................................
904
42.4.6
THE
PROJECT
GETS
A
FACE
..........................................................................
909
42.4.7
DJANGO
S
TEMPLATE
SYSTEM
.....................................................................
915
42.4.8
PROCESSING
FORM
DATA
............................................................................
926
42.4.9
DJANGO S
ADMIN
CONTROL
PANEL
...............................................................
930
43
SCIENTIFIC
COMPUTING
AND
DATA
SCIENCE
935
====*=**==
=****
43.1
INSTALLATION
..................................................................................................
936
43.2
THE
MODEL
PROGRAM
.....................................................................................
936
43.2.1
IMPORTING
NUMPY,
SCIPY,
AND
MATPLOTLIB
..............................................
937
43.2.2
VECTORIZATION
AND
THE
NUMPY.NDARRAY
DATA
TYPE
................................
938
43.2.3
VISUALIZING
DATA
USING
MATPLOTLIB.PYPLOT
............................................
942
43.3
OVERVIEW
OF
THE
NUMPY
AND
SCIPY
MODULES
................................................
944
43.3.1
OVERVIEW
OF
THE
NUMPY.NDARRAY
DATA
TYPE
.............................
944
43.3.2
OVERVIEW
OF
SCIPY
...................................................................................
952
43.4
AN
INTRODUCTION
TO
DATA
ANALYSIS
WITH
PANDAS
...........................................
953
43.4.1
THE
DATAFRAME
OBJECT
...........................................................................
954
43.4.2
SELECTIVE
DATA
ACCESS
.............................................................................
955
43.4.3
DELETING
ROWS
AND
COLUMNS
..................................................................
961
43.4.4
INSERTING
ROWS
AND
COLUMNS
..................................................................
961
43.4.5
LOGICAL
EXPRESSIONS
ON
DATA
RECORDS
.....................................................
962
43.4.6
MANIPULATING
DATA
RECORDS
...................................................................
963
43.4.7
INPUT
AND
OUTPUT
...................................................................................
965
43.4.8
VISUALIZATION
..........................................................................................
966
44
INSIDE
KNOWLEDGE
969
44.1
OPENING
URLS
IN
THE
DEFAULT
BROWSER:
WEBBROWSER
..................................
969
44.2
INTERPRETING
BINARY
DATA:
STRUCT
.................................................................
969
44.3
HIDDEN
PASSWORD
ENTRY
...............................................................................
971
44.3.1
GETPASS([PROMPT,
STREAM])
....................................................................
971
44.3.2
GETPASS.GETUSER()
...................................................................................
972
44.4
COMMAND
LINE
INTERPRETER
..........................................................................
972
44.5
FILE
INTERFACE
FOR
STRINGS;
IO.STRINGLO
..........................................................
975
44.6
GENERATORS
AS
CONSUMERS...........................................................................
976
44.6.1
A
DECORATOR
FOR
CONSUMING
GENERATOR
FUNCTIONS
................................
978
44.6.2
TRIGGERING
EXCEPTIONS
IN
A
GENERATOR
...................................................
978
44.6.3
A
PIPELINE
AS
A
CHAIN
OF
CONSUMING
GENERATOR
FUNCTIONS
..................
979
44.7
COPYING
INSTANCES:
COPY
..............................................................................
981
44.8
IMAGE
PROCESSING:
PILLOW
............................................................................
984
44.8.1
INSTALLATION
.............................................................................................
984
44.8.2
LOADING
AND
SAVING
IMAGE
FILES
............................................................
984
44.8.3
ACCESSING
INDIVIDUAL
PIXELS
...................................................................
985
44.8.4
MANIPULATING
IMAGES
............................................................................
986
44.8.5
INTEROPERABILITY
.....................................................................................
992
45
FROM
PYTHON
2
TO
PYTHON
3
993
45.1
THE
MAIN
DIFFERENCES
....................................................................................
996
45.1.1
INPUT/OUTPUT
..........................................................................................
996
45.1.2
ITERATORS
...................................................................................................
997
45.1.3
STRINGS
.....................................................................................................
998
45.1.4
INTEGERS
....................................................................................................
999
45.1.5
EXCEPTION
HANDLING
...............................................................................
999
45.1.6
STANDARD
LIBRARY
......................................................................................
1000
45.2
AUTOMATIC
CONVERSION
...................................................................................
1001
APPENDICES
1005
A
APPENDIX
........................................................................................................
1005
B
THE
AUTHORS
....................................................................................................
1017
INDEX
..................................................................................................................................
1019
|
adam_txt |
CONTENTS
1
INTRODUCTION
33
1.1
WHY
DID
WE
WRITE
THIS
BOOK?.
33
1.2
WHAT
DOES
THIS
BOOK
PROVIDE?.
34
1.3
STRUCTURE
OF
THE
BOOK
.
34
1.4
HOW
SHOULD
YOU
READ
THIS
BOOK?
.
35
1.5
SAMPLE
PROGRAMS.
36
1.6
PREFACE
TO
THE
FIRST
ENGLISH
EDITION
(2022)
.
36
1.7
ACKNOWLEDGMENTS
.
37
2
THE
PYTHON
PROGRAMMING
LANGUAGE
39
2.1
HISTORY,
CONCEPTS,
AND
AREAS
OF
APPLICATION
.
39
2.1.1
HISTORY
AND
ORIGIN
.
39
2.1.2
BASIC
CONCEPTS
.
40
2.1.3
POSSIBLE
AREAS
OF
USE
AND
STRENGTHS
.
41
2.1.4
EXAMPLES
OF
USE
.
42
2.2
INSTALLING
PYTHON
.
42
2.2.1
INSTALLING
ANACONDA
ON
WINDOWS
.
43
2.2.2
INSTALLING
ANACONDA
ON
LINUX
.
43
2.2.3
INSTALLING
ANACONDA
ON
MACOS
.
44
2.3
INSTALLING
THIRD-PARTY
MODULES
.
45
2.4
USING
PYTHON
.
45
PART
I
GETTING
STARTED
WITH
PYTHON
3
GETTING
STARTED
WITH
THE
INTERACTIVE
MODE
49
3.1
INTEGERS
.
49
3.2
FLOATS
.
51
3.3
CHARACTER
STRINGS
.
51
3.4
LISTS
.
52
3.5
DICTIONARIES
.
53
3.6
VARIABLES
.
54
3.6.1
THE
SPECIAL
MEANING
OF
THE
UNDERSCORE
.
54
3.6.2
IDENTIFIERS
.
55
3.7
LOGICAL
EXPRESSIONS
.
55
3.8
FUNCTIONS
AND
METHODS
.
57
3.8.1
FUNCTIONS
.
57
3.8.2
METHODS
.
58
3.9
SCREEN
OUTPUTS
.
59
3.10
MODULES
.
60
4
THE
PATH
TO
THE
FIRST
PROGRAM
63
4.1
TYPING,
COMPILING,
AND
TESTING
.
63
4.1.1
WINDOWS
.
63
4.1.2
LINUX
AND
MACOS
.
64
4.1.3
SHEBANG
.
65
4.1.4
INTERNAL
PROCESSES
.
65
4.2
BASIC
STRUCTURE
OF
A
PYTHON
PROGRAM
.
66
4.2.1
WRAPPING
LONG
LINES
.
68
4.2.2
JOINING
MULTIPLE
LINES
.
69
4.3
THE
FIRST
PROGRAM
.
70
4.3.1
INITIALIZATION
.
71
4.3.2
LOOP
HEADER
.
71
4.3.3
LOOP
BODY
.
71
4.3.4
SCREEN
OUTPUT
.
72
4.4
COMMENTS
.
72
4.5
IN
CASE
OF
ERROR
.
72
5
CONTROL
STRUCTURES
75
5.1
CONDITIONALS
.
75
5.1.1
THE
IF
STATEMENT
.
75
5.1.2
CONDITIONAL
EXPRESSIONS
.
78
5.2
LOOPS
.
79
5.2.1
THE
WHILE
LOOP
.
79
5.2.2
TERMINATION
OF
A
LOOP
.
80
5.2.3
DETECTING
A
LOOP
BREAK
.
81
5.2.4
ABORTING
THE
CURRENT
ITERATION
.
82
5.2.5
THE
FOR
LOOP
.
84
5.2.6
THE
FOR
LOOP
AS
A
COUNTING
LOOP
.
85
5.3
THE
PASS
STATEMENT
.
87
5.4
ASSIGNMENT
EXPRESSIONS
.
87
5.4.1
THE
GUESSING
NUMBERS
GAME
WITH
ASSIGNMENT
EXPRESSIONS
.
89
6
FILES
9I
6.1
DATA
STREAMS
.
91
6.2
READING
DATA
FROM
A
FILE
.
92
6.2.1
OPENING
AND
CLOSING
A
FILE
.
92
6.2.2
THE
WITH
STATEMENT
.
93
6.2.3
READING
THE
FILE
CONTENT
.
94
6.3
WRITING
DATA
TO
A
FILE
.
96
6.4
GENERATING
THE
FILE
OBJECT
.
97
6.4.1
THE
BUILT-IN
OPEN
FUNCTION
.
97
6.4.2
ATTRIBUTES
AND
METHODS
OF
A
FILE
OBJECT
.
99
6.4.3
CHANGING
THE
WRITE/READ
POSITION
.
100
7
THE
DATA
MODEL
103
7.1
THE
STRUCTURE
OF
INSTANCES
.
105
7.1.1
DATA
TYPE
.
106
7.1.2
VALUE
.
107
7.1.3
IDENTITY
.
108
7.2
DELETING
REFERENCES
.
109
7.3
MUTABLE
VERSUS
IMMUTABLE
DATA
TYPES
.
ILL
8
FUNCTIONS,
METHODS,
AND
ATTRIBUTES
115
MAM=N=MA========S===*********=S*==*TYYRRSCOROS
8.1
PARAMETERS
OF
FUNCTIONS
AND
METHODS
.
115
8.1.1
POSITIONAL
PARAMETERS
.
116
8.1.2
KEYWORD
ARGUMENTS
.
116
8.1.3
OPTIONAL
PARAMETERS
.
117
8.1.4
KEYWORD-ONLY
PARAMETERS
.
117
8.2
ATTRIBUTES
.
118
9
SOURCES
OF
INFORMATION
ON
PYTHON
119
9.1
THE
BUILT-IN
HELP
FUNCTION
.
119
9.2
THE
ONLINE
DOCUMENTATION
.
120
9.3
PEPS
.
120
PART
II
DATA
TYPES
10
BASIC
DATA
TYPES:
AN
OVERVIEW
125
10.1
NOTHINGNESS:
NONETYPE
.
126
10.2
OPERATORS
.
127
10.2.1
OPERATOR
PRECEDENCE
.
127
10.2.2
EVALUATION
ORDER
.
129
10.2.3
CONCATENATING
COMPARISONS
.
129
11
NUMERIC
DATA
TYPES
131
11.1
ARITHMETIC
OPERATORS
.
131
11.2
COMPARISON
OPERATORS
.
133
11.3
CONVERSION
BETWEEN
NUMERIC
DATA
TYPES
.
134
11.4
INTEGERS:
INT
.
135
11.4.1
NUMERAL
SYSTEMS
.
135
11.4.2
BIT
OPERATIONS
.
137
11.4.3
METHODS
.
141
11.5
FLOATS:
FLOAT
.
141
11.5.1
EXPONENTIAL
NOTATION
.
142
11.5.2
PRECISION
.
142
11.5.3
INFINITE
AND
NOT
A
NUMBER
.
143
11.6
BOOLEAN
VALUES:
BOOL
.
144
11.6.1
LOGICAL
OPERATORS
.
144
11.6.2
TRUTH
VALUES
OF
NON-BOOLEAN
DATA
TYPES
.
146
11.6.3
EVALUATING
LOGICAL
OPERATORS
.
148
11.7
COMPLEX
NUMBERS:
COMPLEX
.
149
12
SEQUENTIAL
DATA
TYPES
153
12.1
THE
DIFFERENCE
BETWEEN
TEXT
AND
BINARY
DATA
.
153
12.2
OPERATIONS
ON
INSTANCES
OF
SEQUENTIAL
DATA
TYPES
.
154
12.2.1
CHECKING
FOR
ELEMENTS
.
155
12.2.2
CONCATENATION
.
157
12.2.3
REPETITION
.
158
12.2.4
INDEXING
.
159
12.2.5
SLICING
.
160
12.2.6
LENGTH
OF
A
SEQUENCE
.
164
12.2.7
THE
SMALLEST
AND
THE
LARGEST
ELEMENT
.
164
12.2.8
SEARCHINGFOR
AN
ELEMENT
.
165
12.2.9
COUNTING
ELEMENTS
.
166
12.3
THE
LIST
DATA
TYPE
.
166
12.3.1
CHANGING
A
VALUE
WITHIN
THE
LIST:
ASSIGNMENT
VIA
[]
.
167
12.3.2
REPLACING
SUBLISTS
AND
INSERTING
NEW
ELEMENTS:
ASSIGNMENT
VIA
[]
.
167
12.3.3
DELETING
ELEMENTS
AND
SUBLISTS:
DEL
IN
COMBINATION
WITH
[]
.
168
12.3.4
METHODS
OF
LIST
INSTANCES
.
169
12.3.5
SORTING
LISTS:
S.SORT([KEY,
REVERSE])
.
171
12.3.6
SIDE
EFFECTS
.
174
12.3.7
LIST
COMPREHENSIONS
.
177
12.4 IMMUTABLE
LISTS:
TUPLE
.
179
12.4.1
PACKING
AND
UNPACKING
.
179
12.4.2
IMMUTABLE
DOESN
'
T
NECESSARILY
MEAN
UNCHANGEABLE!
.
181
12.5
STRINGS:
STR,
BYTES,
BYTEARRAY
.
182
12.5.1
CONTROL
CHARACTERS
.
185
12.5.2
STRING
METHODS
.
187
12.5.3
FORMATTING
STRINGS
.
196
12.5.4
CHARACTER
SETS
AND
SPECIAL
CHARACTERS
.
207
13
MAPPINGS
AND
SETS
215
============***************=*******
13.1
DICTIONARY:
DIET
.
215
13.1.1
CREATING
A
DICTIONARY
.
215
13.1.2
KEYS
AND
VALUES
.
216
13.1.3
ITERATION
.
218
13.1.4
OPERATORS
.
219
13.1.5
METHODS
.
221
13.1.6
DIET
COMPREHENSIONS
.
227
13.2
SETS:
SET
AND
FROZENSET
.
227
13.2.1
CREATING
A
SET
.
228
13.2.2
ITERATION
.
229
13.2.3
OPERATORS
.
230
13.2.4
METHODS
.
235
13.2.5
MUTABLE
SETS:
SET
.
236
13.2.6
IMMUTABLE
SETS:
FROZENSET
.
237
14
COLLECTIONS
239
14.1
CHAINED
DICTIONARIES
.
239
14.2
COUNTING
FREQUENCIES
.
240
14.3
DICTIONARIES
WITH
DEFAULT
VALUES
.
242
14.4
DOUBLY
LINKED
LISTS
.
243
14.5
NAMED
TUPLES
.
245
15
DATE
AND
TIME
247
15.1
ELEMENTARY
TIME
FUNCTIONS
-
TIME
.
247
15.1.1
THE
STRUCT_TIME
DATA
TYPE
.
248
15.1.2
CONSTANTS
.
249
15.1.3
FUNCTIONS
.
250
15.2
OBJECT-ORIENTED
DATE
MANAGEMENT:
DATETIME
.
254
15.2.1
DATETIME.DATE
.
255
15.2.2
DATETIME.TIME
.
256
15.2.3
DATETIME.DATETIME
.
257
15.2.4
DATETIME.TIMEDELTA
.
259
15.2.5
OPERATIONS
FOR
DATETIME.DATETIME
AND
DATETIME.DATE
.
262
15.3
TIME
ZONES:
ZONEINFO
.
263
15.3.1
THE
IANA
TIME
ZONE
DATABASE
.
263
15.3.2
SPECIFYING
THE
TIME
IN
LOCAL
TIME
ZONES
.
265
15.3.3
CALCULATING
WITH
TIME
INDICATIONS
IN
LOCAL
TIME
ZONES
.
265
16
ENUMERATIONS
AND
FLAGS
269
16.1
ENUMERATION
TYPES:
ENUM
.
269
16.2
ENUMERATION
TYPES
FOR
BIT
PATTERNS:
FLAG
.
271
16.3
INTEGER
ENUMERATION
TYPES:
INTENUM
.
272
PART
III
ADVANCED
PROGRAMMING
TECHNIQUES
17
FUNCTIONS
277
==========================================================================================
17.1
DEFINING
A
FUNCTION
.
278
17.2
RETURN
VALUES
.
280
17.3
FUNCTION
OBJECTS
.
282
17.4
OPTIONAL
PARAMETERS
.
282
17.5
KEYWORD
ARGUMENTS
.
283
17.6 ARBITRARILY
MANY PARAMETERS
.
284
17.7
KEYWORD-ONLY
PARAMETERS
.
286
17.8
POSITIONAL-ONLY
PARAMETERS
.
287
17.9
UNPACKING
WHEN
CALLING
A
FUNCTION
.
288
17.10
SIDE
EFFECTS
.
290
17.11
NAMESPACES
.
293
17.11.1
ACCESSING
GLOBAL
VARIABLES:
GLOBAL
.
293
17.11.2
ACCESSING
THE
GLOBAL
NAMESPACE
.
294
17.11.3
LOCAL
FUNCTIONS
.
295
17.11.4
ACCESSING
PARENT
NAMESPACES:
NONLOCAL
.
296
17.11.5
UNBOUND
LOCAL
VARIABLES:
A
STUMBLING
BLOCK
.
297
17.12
ANONYMOUS
FUNCTIONS.
299
17.13
RECURSION
.
300
17.14
BUILT-IN
FUNCTIONS
.
300
17.14.1
ABS(X)
.
304
17.14.2
ALL(ITERABLE)
.
304
17.14.3
ANY(ITERABLE)
.
305
17.14.4
ASCII(OBJECT)
.
305
17.14.5
BIN(X)
.
305
17.14.6
BOOL([X])
.
306
17.14.7
BYTEARRAY([SOURCE,
ENCODING,
ERRORS])
.
306
17.14.8
BYTES([SOURCE,
ENCODING,
ERRORS])
.
307
17.14.9
CHR(I)
.
307
17.14.10
COMPLEX([REAL,
IMAG])
.
307
17.14.11
DICT([SOURCE])
.
308
17.14.12
DIVMOD(A,
B)
.
309
17.14.13
ENUMERATE(ITERABLE,
[START])
.
309
17.14.14
EVAL(EXPRESSION,
[GLOBALS,
LOCALS])
.
309
17.14.15
EXEC(OBJECT,
[GLOBALS,
LOCALS])
.
310
17.14.16
FILTER(FUNCTION,
ITERABLE)
.
310
17.14.17
FLOAT([X])
.
311
17.14.18
FORMAT(VALUE,
[FORMAT_SPEC])
.
311
17.14.19
FROZENSET([ITERABLE])
.
311
17.14.20
GLOBALS()
.
312
17.14.21
HASH(OBJECT)
.
312
17.14.22
HELP([OBJECT])
.
313
17.14.23
HEX(X)
.
313
17.14.24
ID(OBJECT)
.
313
17.14.25
INPUT([PROMPT])
.
314
17.14.26
INT([X,
BASE])
.
314
17.14.27
LEN(S)
.
315
17.14.28
LIST([SEQUENCE])
.
315
17.14.29
LOCALS()
.
315
17.14.30
MAP(FUNCTION,
[*ITERABLE])
.
316
17.14.31
MAX(ITERABLE,
{DEFAULT,
KEY}),
MAX(ARGL,
ARG2,
[*ARGS],
{KEY})
.
317
17.14.32
MIN(ITERABLE,
{DEFAULT,
KEY}),
MIN(ARGL,
ARG2,
[*ARGS],
{KEY})
.
318
17.14.33
OCT(X)
.
318
17.14.34
ORD(C)
.
318
17.14.35
POW(X,Y,[Z])
.
318
17.14.36
PRINT([*OBJECTS],
{SEP,
END,
FILE,
FLUSH})
.
318
17.14.37
RANGE([START],
STOP,
[STEP])
.
319
17.14.38
REPR(OBJECT)
.
320
17.14.39
REVERSED(SEQUENCE)
.
320
17.14.40
ROUND(X,
[N])
.
321
17.14.41
SET([ITERABLE])
.
321
17.14.42
SORTED(ITERABLE,
[KEY,
REVERSE])
.
321
17.14.43
STR([OBJECT,
ENCODING,
ERRORS])
.
322
17.14.44
SUM(ITERABLE,
[START])
.
323
17.14.45
TUPLE([ITERABLE])
.
323
17.14.46
TYPE(OBJECT)
.
323
17.14.47
ZIP([*ITERABLES],
{STRICT})
.
324
18
MODULES
AND
PACKAGES
325
18.1
IMPORTING
GLOBAL
MODULES
.
326
18.2
LOCAL
MODULES
.
328
18.2.1
NAME
CONFLICTS
.
329
18.2.2
MODULE-INTERNAL
REFERENCES
.
330
18.2.3
EXECUTING
MODULES
.
330
18.3
PACKAGES
.
331
18.3.1
IMPORTING
ALL
MODULES
OF
A
PACKAGE
.
333
18.3.2
NAMESPACE
PACKAGES
.
333
18.3.3
RELATIVE
IMPORT
STATEMENTS
.
334
18.4
THE
IMPORTLIB
PACKAGE
.
335
18.4.1
IMPORTING
MODULES
AND
PACKAGES
.
335
18.4.2
CHANGING
THE
IMPORT
BEHAVIOR
.
335
18.5
PLANNED
LANGUAGE
ELEMENTS
.
338
19
OBJECT-ORIENTED
PROGRAMMING
341
19.1
EXAMPLE:
A
NON-OBJECT-ORIENTED
ACCOUNT
.
341
19.1.1
CREATING
A
NEW
ACCOUNT
.
342
19.1.2
TRANSFERRING
MONEY
.
342
19.1.3
DEPOSITING
AND
WITHDRAWING
MONEY
.
343
19.1.4
VIEWING
THE
ACCOUNT
BALANCE
.
344
19.2
CLASSES
.
346
19.2.1
DEFINING
METHODS
.
347
19.2.2
THE
CONSTRUCTOR
.
348
19.2.3
ATTRIBUTES
.
349
19.2.4
EXAMPLE:
AN
OBJECT-ORIENTED
ACCOUNT
.
349
19.3
INHERITANCE
.
351
19.3.1
A
SIMPLE
EXAMPLE
.
352
19.3.2
OVERRIDING
METHODS
.
353
19.3.3
EXAMPLE:
CHECKING
ACCOUNT
WITH
DAILY
TURNOVER
.
355
19.3.4
OUTLOOK
.
363
19.4
MULTIPLE
INHERITANCE
.
363
19.5
PROPERTY
ATTRIBUTES
.
365
19.5.1
SETTERS
AND
GETTERS
.
365
19.5.2
DEFINING
PROPERTY
ATTRIBUTES
.
366
19.6
STATIC
METHODS
.
367
19.7
CLASS
METHODS
.
369
19.8
CLASS
ATTRIBUTES
.
370
19.9
BUILT-IN
FUNCTIONS
FOR
OBJECT-ORIENTED
PROGRAMMING
.
370
19.9.1
FUNCTIONSFOR
MANAGING
THE
ATTRIBUTES
OF
AN
INSTANCE
.
371
19.9.2
FUNCTIONS
FOR
INFORMATION
ABOUT
THE
CLASS
HIERARCHY
.
372
19.10
INHERITING
BUILT-IN
DATA
TYPES
.
373
19.11
MAGIC
METHODS
AND
MAGIC
ATTRIBUTES
.
375
19.11.1
GENERAL
MAGIC
METHODS
.
375
19.11.2
OVERLOADING
OPERATORS
.
382
19.11.3
EMULATING
DATA
TYPES:
DUCK
TYPING
.
388
19.12
DATA
CLASSES
.
393
19.12.1
TUPLESAND
LISTS
.
393
19.12.2
DICTIONARIES
.
394
19.12.3
NAMED
TUPLES
.
394
19.12.4
MUTABLE
DATA
CLASSES
.
395
19.12.5
IMMUTABLE
DATA
CLASSES
.
396
19.12.6
DEFAULT
VALUES
IN
DATA
CLASSES
.
396
20
EXCEPTION
HANDLING
399
====================
20.1
EXCEPTIONS
.
399
20.1.1
BUILT-IN
EXCEPTIONS
.
400
20.1.2
RAISING
AN
EXCEPTION
.
401
20.1.3
HANDLING
AN
EXCEPTION
.
401
20.1.4
CUSTOM
EXCEPTIONS
.
406
20.1.5
RE-RAISING
AN
EXCEPTION
.
408
20.1.6
EXCEPTION
CHAINING
.
410
20.2
ASSERTIONS
.
411
20.3
WARNINGS
.
412
21
GENERATORS
AND
ITERATORS
415
21.1
GENERATORS
.
415
21.1.1
SUBGENERATORS
.
418
21.1.2
GENERATOR
EXPRESSIONS
.
421
21.2
ITERATORS
.
422
21.2.1
THE
ITERATOR
PROTOCOL
.
422
21.2.2
EXAMPLE:
THE
FIBONACCI
SEQUENCE
.
423
21.2.3
EXAMPLE:
THE
GOLDEN
RATIO
.
424
21.2.4
A
GENERATOR
FOR
THE
IMPLEMENTATION
OF
_
ITER
.
424
21.2.5
USING
ITERATORS
.
425
21.2.6
MULTIPLE
ITERATORS
FOR
THE
SAME
INSTANCE
.
428
21.2.7
DISADVANTAGES
OF
ITERATORS
COMPARED
TO
DIRECT
ACCESS
VIA
INDEXES
.
430
21.2.8
ALTERNATIVE
DEFINITION
FOR
ITERABLE
OBJECTS
.
430
21.2.9
FUNCTION
ITERATORS
.
431
21.3
SPECIAL
GENERATORS:
ITERTOOLS
.
432
21.3.1
ACCUMULATE(ITERABLE,
[FUNC])
.
433
21.3.2
CHAIN([*ITERA
BLES])
.
433
21.3.3
COMBINATIONS(ITERABLE,
R)
.
434
21.3.4
COMBINATIONS_WITH_REPLACEMENT(ITERABLE,
R)
.
434
21.3.5
COMPRESS(DATA,
SELECTORS)
.
435
21.3.6
COUNT([START,
STEP])
.
435
21.3.7
CYCLE(ITERABLE)
.
436
21.3.8
DROPWHILE(PREDICATE,
ITERABLE)
.
436
21.3.9
FILTERFALSE(PREDICATE,
ITERABLE)
.
436
21.3.10
GROUPBY(ITERABLE,
[KEY])
.
437
21.3.11
ISLICE(ITERABLE,
[START],
STOP,
[STEP])
.
437
21.3.12
PERMUTATIONS(ITERABLE,
[R])
.
438
21.3.13
PRODUCT([*ITERABLES],
[REPEAT])
.
438
21.3.14
REPEAT(OBJECT,
[TIMES])
.
439
21.3.15
STARMAP(FUNCTION,
ITERABLE)
.
439
21.3.16
TAKEWHILE(PREDICATE,
ITERABLE)
.
439
21.3.17
TEE(ITERABLE,
[N])
.
439
21.3.18
ZIP_LONGEST([*ITERABLES],
{FILLVALUE})
.
440
22
CONTEXT
MANAGER
441
22.1
THE
WITH
STATEMENT
.
441
22.1.1
_ENTER_JSELF)
.
443
22.1.2
_
EXIT
_
(SELF,
EXC_TYPE,
EXC_VALUE,
TRACEBACK)
.
444
22.2
HELPER
FUNCTIONS
FOR
WITH
CONTEXTS:
CONTEXTLIB
.
444
22.2.1
DYNAMICALLY
ASSEMBLED
CONTEXT
COMBINATIONS
-
EXITSTACK
.
444
22.2.2
SUPPRESSING
CERTAIN
EXCEPTION
TYPES
.
445
22.2.3
REDIRECTING
THE
STANDARD
OUTPUT
STREAM
.
445
22.2.4
OPTIONAL
CONTEXTS
.
446
22.2.5
SIMPLE
FUNCTIONS
AS
CONTEXT
MANAGER
.
447
23
DECORATORS
449
23.1
FUNCTION
DECORATORS
.
449
23.1.1
DECORATING
FUNCTIONS
AND
METHODS
.
451
23.1.2
NAME
AND
DOCSTRING
AFTER
APPLYING
A
DECORATOR
.
451
23.1.3
NESTED
DECORATORS
.
452
23.1.4
EXAMPLE:
A
CACHE
DECORATOR
.
452
23.2
CLASS
DECORATORS
.
454
23.3 THEFUNCTOOLS
MODULE
.
455
23.3.1
SIMPLIFYING
FUNCTION
INTERFACES
.
455
23.3.2
SIMPLIFYING
METHOD
INTERFACES
.
457
23.3.3
CACHES
.
457
23.3.4
COMPLETINGORDERINGSOF
CUSTOM
CLASSES
.
459
23.3.5
OVERLOADING
FUNCTIONS
.
459
24
ANNOTATIONS
FOR
STATIC
TYPE
CHECKING
463
24.1
ANNOTATIONS
.
464
24.1.1
ANNOTATING
FUNCTIONS
AND
METHODS
.
465
24.1.2
ANNOTATING
VARIABLES
AND
ATTRIBUTES
.
466
24.1.3
ACCESSING
ANNOTATIONS
AT
RUNTIME
.
468
24.1.4
WHEN
ARE
ANNOTATIONS
EVALUATED?
.
470
24.2
TYPE
HINTS:
THE
TYPING
MODULE
.
471
24.2.1
VALID
TYPE
HINTS
.
472
24.2.2
CONTAINER
TYPES
.
472
24.2.3
ABSTRACT
CONTAINER
TYPES
.
473
24.2.4
TYPE
ALIASES
.
474
24.2.5
TYPE
UNIONS
AND
OPTIONAL
VALUES
.
474
24.2.6
TYPE
VARIABLES
.
475
24.3
STATIC
TYPE
CHECKING
IN
PYTHON:
MYPY
.
476
24.3.1
INSTALLATION
.
476
24.3.2
EXAMPLE
.
477
25
STRUCTURAL
PATTERN
MATCHING
479
25.1
THE
MATCH
STATEMENT
.
479
25.2
PATTERN
TYPES
IN
THE
CASE
STATEMENT
.
480
25.2.1
LITERAL
AND
VALUE
PATTERNS
.
481
25.2.2
OR
PATTERN
.
481
25.2.3
PATTERNS
WITH
TYPE
CHECKING
.
482
25.2.4
SPECIFYING
CONDITIONS
FOR
MATCHES
.
483
25.2.5
GROUPING
SUBPATTERNS
.
483
25.2.6
CAPTURE
AND
WILDCARD
PATTERNS
.
484
25.2.7
SEQUENCE
PATTERNS
.
486
25.2.8
MAPPING
PATTERNS
.
488
25.2.9
PATTERNS
FOR
OBJECTS
AND
THEIR
ATTRIBUTE
VALUES
.
490
PART
IV
THE
STANDARD
LIBRARY
26
MATHEMATICS
497
*=MS=MM====A====***S******=***********ESROGYESYLN*
26.1
MATHEMATICAL
FUNCTIONS:
MATH,
CMATH
.
497
26.1.1
GENERAL
MATHEMATICAL
FUNCTIONS
.
498
26.1.2
EXPONENTIAL
AND
LOGARITHM
FUNCTIONS
.
501
26.1.3
TRIGONOMETRIC
AND
HYPERBOLIC
FUNCTIONS
.
501
26.1.4
DISTANCES
AND
NORMS
.
502
26.1.5
CONVERTING
ANGLES
.
502
26.1.6
REPRESENTATIONS
OF
COMPLEX
NUMBERS
.
502
26.2
RANDOM
NUMBER
GENERATOR:
RANDOM
.
503
26.2.1
SAVING
AND
LOADING
THE
RANDOM
STATE
.
504
26.2.2
GENERATING
RANDOM
INTEGERS
.
504
26.2.3
GENERATING
RANDOM
FLOATS
.
505
26.2.4
RANDOM
OPERATIONS
ON
SEQUENCES
.
505
26.2.5
SYSTEMRANDOM([SEED])
.
507
26.3
STATISTICAL
CALCULATIONS:
STATISTICS
.
507
26.4
INTUITIVE
DECIMAL
NUMBERS:
DECIMAL
.
509
26.4.1
USING
THE
DATA
TYPE
.
509
26.4.2
NONNUMERIC
VALUES
.
512
26.4.3
THE
CONTEXT
OBJECT
.
513
26.5
HASH
FUNCTIONS:
HASHLIB
.
514
26.5.1
USING
THE
MODULE
.
516
26.5.2
OTHER
HASH
ALGORITHMS
.
517
26.5.3
COMPARING
LARGE
FILES
.
517
26.5.4
PASSWORDS
.
518
27
SCREEN
OUTPUTS
AND
LOGGING
521
27.1
FORMATTED
OUTPUT
OF
COMPLEX
OBJECTS:
PPRINT
.
521
27.2
LOG
FILES:
LOGGING
.
523
27.2.1
CUSTOMIZING
THE
MESSAGE
FORMAT
.
525
27.2.2
LOGGING
HANDLERS
.
527
28
REGULAR
EXPRESSIONS
529
28.1
SYNTAX
OF
REGULAR
EXPRESSIONS
.
529
28.1.1
ANY
CHARACTER
.
530
28.1.2
CHARACTER
CLASSES
.
530
28.1.3
QUANTIFIERS
.
531
28.1.4
PREDEFINED
CHARACTER
CLASSES
.
533
28.1.5
OTHER
SPECIAL
CHARACTERS
.
534
28.1.6
NONGREEDY
QUANTIFIERS
.
535
28.1.7
GROUPS
.
536
28.1.8
ALTERNATIVES
.
536
28.1.9
EXTENSIONS
.
537
28.2
USING
THE
RE
MODULE
.
539
28.2.1
SEARCHING
.
540
28.2.2
MATCHING
.
540
28.2.3
SPLITTING
A
STRING
.
541
28.2.4
REPLACING
PARTS
OF
A
STRING
.
541
28.2.5
REPLACING
PROBLEM
CHARACTERS
.
542
28.2.6
COMPILING
A
REGULAR
EXPRESSION
.
542
28.2.7
FLAGS
.
543
28.2.8
THE
MATCH
OBJECT
.
544
28.3
A
SIMPLE
SAMPLE
PROGRAM:
SEARCHING
.
546
28.4
A
MORE
COMPLEX
SAMPLE
PROGRAM:
MATCHING
.
547
28.5
COMMENTS
IN
REGULAR
EXPRESSIONS
.
550
29
INTERFACE
TO
OPERATING
SYSTEM
AND
RUNTIME
ENVIRONMENT
553
29.1
OPERATING
SYSTEM
FUNCTIONALITY:
OS
.
553
29.1.1
ENVIRON
.
554
29.1.2
GETPID()
.
554
29.1.3
CPU_COUNT()
.
554
29.1.4
SYSTEM(CMD)
.
554
29.1.5
POPEN(COMMAND,
[MODE,
BUFFERING])
.
555
29.2
ACCESSING
THE
RUNTIME
ENVIRONMENT:
SYS
.
555
29.2.1
COMMAND
LINE
PARAMETERS
.
556
29.2.2
DEFAULT
PATHS
.
556
29.2.3
STANDARD
INPUT/OUTPUT
STREAMS
.
556
29.2.4
EXITING
THE
PROGRAM
.
556
29.2.5
DETAILS
OF
THE
PYTHON
VERSION
.
557
29.2.6
OPERATING
SYSTEM
DETAILS
.
557
29.2.7
HOOKS
.
559
29.3
COMMAND
LINE
PARAMETERS:
ARGPARSE
.
561
29.3.1
CALCULATOR:
A
SIMPLE
EXAMPLE
.
562
29.3.2
A
MORE
COMPLEX
EXAMPLE
.
566
30
FILE
SYSTEM
569
30.1
ACCESSING
THE
FILE
SYSTEM:
OS
.
569
30.1.1
ACCESS(PATH,
MODE)
.
570
30.1.2
CHMOD(PATH,
MODE)
.
571
30.1.3
LISTDIR([PATH])
.
571
30.1.4
MKDIR(PATH,
[MODE])
AND
MAKEDIRS(PATH,
[MODE])
.
572
30.1.5
REMOVE(PATH)
.
572
30.1.6
REMOVEDIRS(PATH)
.
572
30.1.7
RENAME(SRC,
DST)
AND
RENAMES(OLD,
NEW)
.
573
30.1.8
WALK(TOP,
[TOPDOWN,
ONERROR])
.
573
30.2
FILE
PATHS:
OS.PATH
.
575
30.2.1
ABSPATH(PATH)
.
576
30.2.2
BASENAME(PATH)
.
577
30.2.3
COMMONPREFIX(LIST)
.
577
30.2.4
DIRNAME(PATH)
.
577
30.2.5
JOIN(PATH,
*PATHS)
.
578
30.2.6
NORMCASE(PATH)
.
578
30.2.7
SPLIT(PATH)
.
578
30.2.8
SPLITDRIVE(PATH)
.
579
30.2.9
SPLITEXT(PATH)
.
579
30.3
ACCESSING
THE
FILE
SYSTEM:
SHUTIL
.
579
30.3.1
DIRECTORY
AND
FILE
OPERATIONS
.
581
30.3.2
ARCHIVE
OPERATIONS
.
582
30.4
TEMPORARY
FILES:
TEMPFILE
.
585
30.4.1
TEMPORARYFILE([MODE,
[BUFSIZE,
SUFFIX,
PREFIX,
DIR])
.
585
30.4.2
TEMPFILE.TEMPORARYDIRECTORY([SUFFIX,
PREFIX,
DIR])
.
586
31
PARALLEL
PROGRAMMING
587
31.1
PROCESSES,
MULTITASKING,
AND
THREADS
.
587
31.1.1
THE
LIGHTWEIGHTS
AMONG
THE
PROCESSES:
THREADS
.
588
31.1.2
THREADS
OR
PROCESSES?
.
590
31.1.3
COOPERATIVE
MULTITASKING:
A
THIRD
WAY
.
590
31.2
PYTHON
'
S
INTERFACES
FOR
PARALLELIZATION
.
591
31.3
THE
ABSTRACT
INTERFACE:
CONCURRENT.FUTURES
.
592
31.3.1
AN
EXAMPLE
WITH
A
FUTURES.THREADPOOLEXECUTOR
.
593
31.3.2
EXECUTOR
INSTANCES
AS
CONTEXT
MANAGERS
.
595
31.3.3
USING
FUTURES.PROCESSPOOLEXECUTOR
.
595
31.3.4
MANAGING
THE
TASKS
OF
AN
EXECUTOR
.
596
31.4
THE
FLEXIBLE
INTERFACE:
THREADING
AND
MULTIPROCESSING
.
602
31.4.1
THREADS
IN
PYTHON:
THREADING
.
603
31.4.2
PROCESSES
IN
PYTHON:
MULTIPROCESSING
.
611
31.5
COOPERATIVE
MULTITASKING
.
613
31.5.1
COOPERATIVE
FUNCTIONS:
COROUTINES
.
613
31.5.2
AWAITABLE
OBJECTS
.
614
31.5.3
THE
COOPERATION
OF
COROUTINES:
TASKS
.
615
31.5.4
A
COOPERATIVE WEB
CRAWLER
.
618
31.5.5
BLOCKING
OPERATIONS
IN
COROUTINES
.
625
31.5.6
OTHER
ASYNCHRONOUS
LANGUAGE
FEATURES
.
627
31.6
CONCLUSION:
WHICH
INTERFACE
IS
THE
RIGHT
ONE?
.
629
31.6.1
IS
COOPERATIVE
MULTITASKING
AN
OPTION?
.
629
31.6.2
ABSTRACTION
OR
FLEXIBILITY?
.
630
31.6.3
THREADS
OR
PROCESSES?
.
630
32
DATA
STORAGE
631
32.1
XML
.
631
32.1.1
ELEMENTTREE
.
633
32.1.2
SIMPLE
API
FOR
XML
.
640
32.2
DATABASES.
643
32.2.1
THE
BUILT-IN
DATABASE
IN
PYTHON:
SQLITE3
.
646
32.3
COMPRESSED
FILES
AND
ARCHIVES
.
661
32.3.1
GZIP.OPEN(FILENAME,
[MODE,
COMPRESSLEVEL])
.
661
32.3.2
OTHER
MODULES
FOR
ACCESSING
COMPRESSED
DATA
.
662
32.4
SERIALIZING
INSTANCES:
PICKLE
.
662
32.4.1
FUNCTIONAL
INTERFACE
.
663
32.4.2
OBJECT-ORIENTED
INTERFACE
.
665
32.5
THE
JSON
DATA
EXCHANGE
FORMAT:
JSON
.
665
32.6
THE
CSV
TABLE
FORMAT:
CSV
.
667
32.6.1
READING
DATA
FROM
A
CSV
FILE
WITH
READER
OBJECTS
.
668
32.6.2
USING
CUSTOM
DIALECTS:
DIALECT
OBJECTS
.
670
33
NETWORK
COMMUNICATION
673
33.1
SOCKET
API
.
674
33.1.1
CLIENT-SERVER
SYSTEMS
.
675
33.1.2
UDP
.
677
33.1.3
TCP
.
678
33.1.4
BLOCKING
AND
NONBLOCKING
SOCKETS
.
680
33.1.5
CREATING
A
SOCKET
.
681
33.1.6
THE
SOCKET
CLASS
.
682
33.1.7
NETWORK
BYTE
ORDER
.
685
33.1.8
MULTIPLEXING
SERVERS:
SELECTORS
.
686
33.1.9
OBJECT-ORIENTED
SERVER
DEVELOPMENT:
SOCKETSERVER
.
688
33.2
XML-RPC
.
690
33.2.1
THESERVER
.
691
33.2.2
THE
CLIENT
.
694
33.2.3
MULTICALL
.
696
33.2.4
LIMITATIONS
.
697
34
ACCESSING
RESOURCES
ON
THE
INTERNET
701
34.1
PROTOCOLS.
701
34.1.1
HYPERTEXT
TRANSFER
PROTOCOL
.
701
34.1.2
FILE
TRANSFER
PROTOCOL
.
701
34.2
SOLUTIONS
.
702
34.2.1
OUTDATED
SOLUTIONS
FOR
PYTHON
2
.
702
34.2.2
SOLUTIONS
IN
THE
STANDARD
LIBRARY
.
702
34.2.3
THIRD-PARTY
SOLUTIONS
.
702
34.3
THE
EASY
WAY:
REQUESTS
.
703
34.3.1
SIMPLE
REQUESTS
VIA
GET
AND
POST.
703
34.3.2
WEB
APIS
.
704
34.4
URLS:
URLLIB
.
705
34.4,1
ACCESSING
REMOTE
RESOURCES:
URLLIB.REQUEST
.
706
34.4.2
READING
AND
PROCESSING
URLS:
URLLIB.PARSE
.
710
34.5
FTP:
FTPLIB
.
713
34.5.1
CONNECTING
TO
AN
FTP
SERVER
.
714
34.5.2
EXECUTING
FTP
COMMANDS
.
715
34.5.3
WORKING
WITH
FILES
AND
DIRECTORIES
.
715
34.5.4
TRANSFERRING
FILES
.
716
35
EMAIL
721
35.1
SMTP:
SMTPLIB
.
721
35.1.1
SMTP([HOST,
PORT,
LOCAL_HOSTNAME,
TIMEOUT,
SOURCE_ADDRESS])
.
722
35.1.2
ESTABLISHING
AND
TERMINATING
A
CONNECTION
.
722
35.1.3
SENDING
AN
EMAIL
.
723
35.1.4
EXAMPLE
.
724
35.2
POP3:
POPIIB
.
724
35.2.1
POP3(HOST,
[PORT,
TIMEOUT])
.
725
35.2.2
ESTABLISHING
AND
TERMINATING
A
CONNECTION
.
725
35.2.3
LISTING
EXISTING
EMAILS
.
726
35.2.4
RETRIEVING
AND
DELETING
EMAILS
.
727
35.2.5
EXAMPLE
.
727
35.3
IMAP4:
IMAPLIB
.
728
35.3.1
IMAP4([HOST,
PORT,TIMEOUT])
.
729
35.3.2
ESTABLISHING
AND
TERMINATING
A
CONNECTION
.
730
35.3.3
FINDING
AND
SELECTING
A
MAILBOX
.
730
35.3.4
OPERATIONS
WITH
MAILBOXES
.
731
35.3.5
SEARCHING
EMAILS
.
731
35.3.6
RETRIEVING
EMAILS
.
732
35.3.7
EXAMPLE
.
733
35.4
CREATING
COMPLEX
EMAILS:
EMAIL
.
734
35.4.1
CREATING
A
SIMPLE
EMAIL
.
734
35.4.2
CREATING
AN
EMAIL
WITH
ATTACHMENTS
.
735
35.4.3
READING
AN
EMAIL
.
737
36
DEBUGGING
AND
QUALITY
ASSURANCE
739
MMM==SA=M==M===**S***S=*****S==*==*SENOS
36.1
THE
DEBUGGER
.
739
36.2
AUTOMATED
TESTING
.
741
36.2.1
TEST
CASES
IN
DOCSTRINGS:
DOCTEST
.
742
36.2.2
UNIT
TESTS:
UNITTEST
.
746
36.3
ANALYZING
THE
RUNTIME
PERFORMANCE
.
749
36.3.1
RUNTIME
MEASUREMENT:
TIMEIT
.
749
36.3.2
PROFILING:
CPROFILE
.
752
36.3.3
TRACING:
TRACE
.
756
37
DOCUMENTATION
759
37.1
DOCSTRINGS
.
759
37.2
AUTOMATICALLY
GENERATED
DOCUMENTATION:
PYDOC
.
761
PARTV
ADVANCED
TOPICS
38
DISTRIBUTING
PYTHON
PROJECTS
765
38.1
A
HISTORY
OF
DISTRIBUTIONS
IN
PYTHON
.
765
38.1.1
THE
CLASSIC
APPROACH:
DISTUTILS
.
766
38.1.2
THE
NEW
STANDARD:
SETUPTOOLS
.
766
38.1.3
THE
PACKAGE
INDEX:
PYPI
.
766
38.2
CREATING
DISTRIBUTIONS:
SETUPTOOLS
.
767
38.2.1
INSTALLATION
.
767
38.2.2
WRITING
THE
MODULE
.
767
38.2.3
THE
INSTALLATION
SCRIPT
.
768
38.2.4
CREATING
A
SOURCE
DISTRIBUTION
.
773
38.2.5
CREATING
A
BINARY
DISTRIBUTION
.
773
38.2.6
INSTALLING
DISTRIBUTIONS
.
774
38.3
CREATING
EXE
FILES:
CX_FREEZE
.
775
38.3.1
INSTALLATION
.
775
38.3.2
USAGE
.
775
38.4
PACKAGE
MANAGER
.
776
38.4.1
THE
PYTHON
PACKAGE
MANAGER:
PIP
.
777
38.4.2
THE
CONDA
PACKAGE
MANAGER
.
778
38.5
LOCALIZING
PROGRAMS:
GETTEXT
.
781
38.5.1
EXAMPLE
OF
USING
GETTEXT
.
781
38.5.2
CREATING
THE
LANGUAGE
COMPILATION
.
783
39
VIRTUAL
ENVIRONMENTS
785
39.1
USING
VIRTUAL
ENVIRONMENTS:
VENV
.
786
39.1.1
ACTIVATING
A
VIRTUAL
ENVIRONMENT
.
786
39.1.2
WORKING
IN
A
VIRTUAL
ENVIRONMENT
.
786
39.1.3
DEACTIVATING
A
VIRTUAL
ENVIRONMENT
.
787
39.2
VIRTUAL
ENVIRONMENTS
IN
ANACONDA
.
787
40
ALTERNATIVE
INTERPRETERS
AND
COMPILERS
789
40.1
JUST-IN-TIME
COMPILATION:
PYPY
.
789
40.1.1
INSTALLATION
AND
USE
.
789
40.1.2
EXAMPLE
.
790
40.2
NUMBA
.
790
40.2.1
INSTALLATION
.
791
40.2.2
EXAMPLE
.
791
40.3
CONNECTING
TO
C
AND
C++:
CYTHON
.
793
40.3.1
INSTALLATION
.
793
40.3.2
THE
FUNCTIONALITY
OF
CYTHON
.
794
40.3.3
COMPILING
A
CYTHON
PROGRAM
.
794
40.3.4
A
CYTHON
PROGRAM
WITH
STATIC
TYPING
.
796
40.3.5
USING
A
C
LIBRARY
.
797
40.4
THE
INTERACTIVE
PYTHON
SHELL:
IPYTHON
.
799
40.4.1
INSTALLATION
.
799
40.4.2
THE
INTERACTIVE
SHELL
.
799
40.4.3
THE
JUPYTER
NOTEBOOK
.
802
41
GRAPHICAL
USER
INTERFACES
805
=MSS=======AAR===============MMNA
"
A
"
=*M=MMMAAMAAASASSASANAAAZANAZAANANANANOZAMZZZEANAN
41.1
TOOLKITS
.
805
41.1.1
TKINTER(TK)
.
805
41.1.2
PYGOBJECT
(GTK)
.
806
41.1.3
QT
FOR
PYTHON
(QT)
.
806
41.1.4
WXPYTHON
(WXWIDGETS)
.
807
41.2
INTRODUCTION
TO
TKINTER
.
807
41.2.1
A
SIMPLE
EXAMPLE
.
807
41.2.2
CONTROL
VARIABLES
.
810
41.2.3
THE
PACKER
.
811
41.2.4
EVENTS
.
815
41.2.5
WIDGETS
.
821
41.2.6
DRAWINGS:
THE
CANVAS
WIDGET
.
839
41.2.7
OTHER
MODULES
.
846
41.3
INTRODUCTION
TO
PYSIDE6
.
850
41.3.1
INSTALLATION
.
850
41.3.2
BASIC
CONCEPTS
OF
QT
.
850
41.3.3
DEVELOPMENT
PROCESS
.
852
41.4
SIGNALS
AND
SLOTS
.
859
41.5
IMPORTANT
WIDGETS
.
861
41.5.1
QCHECKBOX
.
862
41.5.2
QCOMBOBOX
.
862
41.5.3
QDATEEDIT,
QTIMEEDIT,
AND
QDATETIMEEDIT
.
863
41.5.4
QDIALOG
.
863
41.5.5
QLINEEDIT
.
864
41.5.6
QLISTWIDGET
AND
QLISTVIEW
.
864
41.5.7
QPROGRESSBAR
.
865
41.5.8
QPUSHBUTTON
.
865
41.5.9
QRADIOBUTTON
.
865
41.5.10
QSLIDER
AND
QDIAL
.
866
41.5.11
QTEXTEDIT
.
866
41.5.12
QWIDGET
.
867
41.6
DRAWING
FUNCTIONALITY
.
868
41.6.1
TOOLS
.
868
41.6.2
COORDINATE
SYSTEM
.
870
41.6.3
SIMPLE
SHAPES
.
871
41.6.4
IMAGES
.
873
41.6.5
TEXT
.
874
41.6.6
EYE
CANDY
.
876
41.7
MODEL-VIEW
ARCHITECTURE
.
879
41.7.1
SAMPLE
PROJECT:
AN
ADDRESS
BOOK
.
880
41.7.2
SELECTING
ENTRIES
.
888
41.7.3
EDITING
ENTRIES
.
890
42
PYTHON
AS
A
SERVER-SIDE
PROGRAMMING
LANGUAGE
ON
THE
WEB:
AN
INTRODUCTION
TO
DJANGO
893
IAMHMSLRTTMKRMWFTTNFTTTTTTTTLFTYTTTCTTTTRTTCTT"TTITTTTTYTTTTTYT"TTTTTTTTTTTTYTTTTT"TTTTCTTEETTTTTTYTT"TTTTTTTYTTTTN
TTTMTTTTTTTTTTTTITYNTTTTTTNTFT
TEFTTFYMUNYHST
OKHTNT
UEWWVUGWNFNWWFYMMWNYWYHNRTH
42.1
CONCEPTS
AND
FEATURES
OF
DJANGO
.
894
42.2
INSTALLING
DJANGO
.
895
42.3
CREATING
A
NEW
DJANGO
PROJECT
.
896
42.3.1
THE
DEVELOPMENT
WEB
SERVER
.
897
42.3.2
CONFIGURING
THE
PROJECT
.
898
42.4
CREATING
AN
APPLICATION
.
900
42.4.1
IMPORTING
THE
APPLICATION
INTO
THE
PROJECT
.
901
42.4.2
DEFINING
A
MODEL
.
901
42.4.3
RELATIONSHIPS
BETWEEN
MODELS
.
902
42.4.4
TRANSFERRING
THE
MODEL
TO
THE
DATABASE
.
903
42.4.5
THE
MODEL
API
.
904
42.4.6
THE
PROJECT
GETS
A
FACE
.
909
42.4.7
DJANGO
'
S
TEMPLATE
SYSTEM
.
915
42.4.8
PROCESSING
FORM
DATA
.
926
42.4.9
DJANGO'S
ADMIN
CONTROL
PANEL
.
930
43
SCIENTIFIC
COMPUTING
AND
DATA
SCIENCE
935
====*=**==
"
=****
43.1
INSTALLATION
.
936
43.2
THE
MODEL
PROGRAM
.
936
43.2.1
IMPORTING
NUMPY,
SCIPY,
AND
MATPLOTLIB
.
937
43.2.2
VECTORIZATION
AND
THE
NUMPY.NDARRAY
DATA
TYPE
.
938
43.2.3
VISUALIZING
DATA
USING
MATPLOTLIB.PYPLOT
.
942
43.3
OVERVIEW
OF
THE
NUMPY
AND
SCIPY
MODULES
.
944
43.3.1
OVERVIEW
OF
THE
NUMPY.NDARRAY
DATA
TYPE
.
944
43.3.2
OVERVIEW
OF
SCIPY
.
952
43.4
AN
INTRODUCTION
TO
DATA
ANALYSIS
WITH
PANDAS
.
953
43.4.1
THE
DATAFRAME
OBJECT
.
954
43.4.2
SELECTIVE
DATA
ACCESS
.
955
43.4.3
DELETING
ROWS
AND
COLUMNS
.
961
43.4.4
INSERTING
ROWS
AND
COLUMNS
.
961
43.4.5
LOGICAL
EXPRESSIONS
ON
DATA
RECORDS
.
962
43.4.6
MANIPULATING
DATA
RECORDS
.
963
43.4.7
INPUT
AND
OUTPUT
.
965
43.4.8
VISUALIZATION
.
966
44
INSIDE
KNOWLEDGE
969
44.1
OPENING
URLS
IN
THE
DEFAULT
BROWSER:
WEBBROWSER
.
969
44.2
INTERPRETING
BINARY
DATA:
STRUCT
.
969
44.3
HIDDEN
PASSWORD
ENTRY
.
971
44.3.1
GETPASS([PROMPT,
STREAM])
.
971
44.3.2
GETPASS.GETUSER()
.
972
44.4
COMMAND
LINE
INTERPRETER
.
972
44.5
FILE
INTERFACE
FOR
STRINGS;
IO.STRINGLO
.
975
44.6
GENERATORS
AS
CONSUMERS.
976
44.6.1
A
DECORATOR
FOR
CONSUMING
GENERATOR
FUNCTIONS
.
978
44.6.2
TRIGGERING
EXCEPTIONS
IN
A
GENERATOR
.
978
44.6.3
A
PIPELINE
AS
A
CHAIN
OF
CONSUMING
GENERATOR
FUNCTIONS
.
979
44.7
COPYING
INSTANCES:
COPY
.
981
44.8
IMAGE
PROCESSING:
PILLOW
.
984
44.8.1
INSTALLATION
.
984
44.8.2
LOADING
AND
SAVING
IMAGE
FILES
.
984
44.8.3
ACCESSING
INDIVIDUAL
PIXELS
.
985
44.8.4
MANIPULATING
IMAGES
.
986
44.8.5
INTEROPERABILITY
.
992
45
FROM
PYTHON
2
TO
PYTHON
3
993
45.1
THE
MAIN
DIFFERENCES
.
996
45.1.1
INPUT/OUTPUT
.
996
45.1.2
ITERATORS
.
997
45.1.3
STRINGS
.
998
45.1.4
INTEGERS
.
999
45.1.5
EXCEPTION
HANDLING
.
999
45.1.6
STANDARD
LIBRARY
.
1000
45.2
AUTOMATIC
CONVERSION
.
1001
APPENDICES
1005
A
APPENDIX
.
1005
B
THE
AUTHORS
.
1017
INDEX
.
1019 |
any_adam_object | 1 |
any_adam_object_boolean | 1 |
author | Ernesti, Johannes Kaiser, Peter |
author_GND | (DE-588)13382621X |
author_facet | Ernesti, Johannes Kaiser, Peter |
author_role | aut aut |
author_sort | Ernesti, Johannes |
author_variant | j e je p k pk |
building | Verbundindex |
bvnumber | BV048851514 |
ctrlnum | (OCoLC)1374560856 (DE-599)DNB1260567850 |
edition | 1st edition |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>02005nam a22004818c 4500</leader><controlfield tag="001">BV048851514</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20240503 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">230308s2022 gw a||| |||| 00||| eng d</controlfield><datafield tag="015" ind1=" " ind2=" "><subfield code="a">22,N26</subfield><subfield code="2">dnb</subfield></datafield><datafield tag="016" ind1="7" ind2=" "><subfield code="a">1260567850</subfield><subfield code="2">DE-101</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">149322302X</subfield><subfield code="9">1-4932-2302-X</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781493223022</subfield><subfield code="c">pbk: EUR 56.03 (DE), EUR 59.95 (DE) (freier Preis), EUR 61.70 (AT) (freier Preis), CHF 76.95 (freier Preis)</subfield><subfield code="9">978-1-4932-2302-2</subfield></datafield><datafield tag="024" ind1="3" ind2=" "><subfield code="a">9781493223022</subfield></datafield><datafield tag="028" ind1="5" ind2="2"><subfield code="a">Bestellnummer: 459/22302</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)1374560856</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)DNB1260567850</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="044" ind1=" " ind2=" "><subfield code="a">gw</subfield><subfield code="c">XA-DE</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-29T</subfield><subfield code="a">DE-B768</subfield><subfield code="a">DE-898</subfield><subfield code="a">DE-573</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="8">1\p</subfield><subfield code="a">004</subfield><subfield code="2">23sdnb</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Ernesti, Johannes</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)13382621X</subfield><subfield code="4">aut</subfield></datafield><datafield tag="240" ind1="1" ind2="0"><subfield code="a">Python 3 (2021 : 6. Auflage)</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Python 3</subfield><subfield code="b">the comprehensive guide</subfield><subfield code="c">Johannes Ernesti, Peter Kaiser</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">1st edition</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Boston, Ma</subfield><subfield code="b">Rheinwerk Publishing</subfield><subfield code="c">[2022]</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">1036 Seiten</subfield><subfield code="b">Illustrationen</subfield><subfield code="c">25.4 cm x 17.8 cm</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Python 3.x</subfield><subfield code="0">(DE-588)7692360-5</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">Python client for SAP HANA</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">SAP Python</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Python 3.x</subfield><subfield code="0">(DE-588)7692360-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Kaiser, Peter</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="710" ind1="2" ind2=" "><subfield code="a">Galileo Press Inc.</subfield><subfield code="0">(DE-588)106510992X</subfield><subfield code="4">pbl</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">X:MVB</subfield><subfield code="q">text/html</subfield><subfield code="u">http://deposit.dnb.de/cgi-bin/dokserv?id=4c8868641f334ddf841ae582072a7067&prov=M&dok_var=1&dok_ext=htm</subfield><subfield code="3">Inhaltstext</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">DNB Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=034116778&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-034116778</subfield></datafield><datafield tag="883" ind1="1" ind2=" "><subfield code="8">1\p</subfield><subfield code="a">vlb</subfield><subfield code="d">20220622</subfield><subfield code="q">DE-101</subfield><subfield code="u">https://d-nb.info/provenance/plan#vlb</subfield></datafield></record></collection> |
id | DE-604.BV048851514 |
illustrated | Illustrated |
index_date | 2024-07-03T21:40:18Z |
indexdate | 2024-07-10T09:47:49Z |
institution | BVB |
institution_GND | (DE-588)106510992X |
isbn | 149322302X 9781493223022 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-034116778 |
oclc_num | 1374560856 |
open_access_boolean | |
owner | DE-29T DE-B768 DE-898 DE-BY-UBR DE-573 |
owner_facet | DE-29T DE-B768 DE-898 DE-BY-UBR DE-573 |
physical | 1036 Seiten Illustrationen 25.4 cm x 17.8 cm |
publishDate | 2022 |
publishDateSearch | 2022 |
publishDateSort | 2022 |
publisher | Rheinwerk Publishing |
record_format | marc |
spelling | Ernesti, Johannes Verfasser (DE-588)13382621X aut Python 3 (2021 : 6. Auflage) Python 3 the comprehensive guide Johannes Ernesti, Peter Kaiser 1st edition Boston, Ma Rheinwerk Publishing [2022] 1036 Seiten Illustrationen 25.4 cm x 17.8 cm txt rdacontent n rdamedia nc rdacarrier Python 3.x (DE-588)7692360-5 gnd rswk-swf Python client for SAP HANA SAP Python Python 3.x (DE-588)7692360-5 s DE-604 Kaiser, Peter Verfasser aut Galileo Press Inc. (DE-588)106510992X pbl X:MVB text/html http://deposit.dnb.de/cgi-bin/dokserv?id=4c8868641f334ddf841ae582072a7067&prov=M&dok_var=1&dok_ext=htm Inhaltstext DNB Datenaustausch application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=034116778&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis 1\p vlb 20220622 DE-101 https://d-nb.info/provenance/plan#vlb |
spellingShingle | Ernesti, Johannes Kaiser, Peter Python 3 the comprehensive guide Python 3.x (DE-588)7692360-5 gnd |
subject_GND | (DE-588)7692360-5 |
title | Python 3 the comprehensive guide |
title_alt | Python 3 (2021 : 6. Auflage) |
title_auth | Python 3 the comprehensive guide |
title_exact_search | Python 3 the comprehensive guide |
title_exact_search_txtP | Python 3 the comprehensive guide |
title_full | Python 3 the comprehensive guide Johannes Ernesti, Peter Kaiser |
title_fullStr | Python 3 the comprehensive guide Johannes Ernesti, Peter Kaiser |
title_full_unstemmed | Python 3 the comprehensive guide Johannes Ernesti, Peter Kaiser |
title_short | Python 3 |
title_sort | python 3 the comprehensive guide |
title_sub | the comprehensive guide |
topic | Python 3.x (DE-588)7692360-5 gnd |
topic_facet | Python 3.x |
url | http://deposit.dnb.de/cgi-bin/dokserv?id=4c8868641f334ddf841ae582072a7067&prov=M&dok_var=1&dok_ext=htm http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=034116778&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT ernestijohannes python320216auflage AT kaiserpeter python320216auflage AT galileopressinc python320216auflage AT ernestijohannes python3thecomprehensiveguide AT kaiserpeter python3thecomprehensiveguide AT galileopressinc python3thecomprehensiveguide |