
Haben Sie noch nichts passendes gefunden? Stöbern Sie durch unser komplettes Sortiment.
Oder melden Sie sich an bzw. registrieren Sie sich.


Beschreibung
Ready to master Python? In this updated edition of the prize-winning Python reference, learn to write effective code, whether you're a beginner or a professional programmer. Review core Python concepts, including functions, modularization, and object orientat...
Ready to master Python? In this updated edition of the prize-winning Python reference, learn to write effective code, whether you're a beginner or a professional programmer. Review core Python concepts, including functions, modularization, and object orientation, and walk through the available data types. Then dive into more advanced topics, such as exception handling, static type checking, and regular expressions. With mountains of code examples throughout, this hands-on reference guide has everything you need to become proficient in Python!
Highlights includes:
Functions
Methods
Attributes
Data types
GUIs
Debugging
Network communication
Modularization
Object orientation
Iterators
11)Generators
12)Exception handling
Download and consult practical code examples
Inhalt
1 ... Introduction ... 31
1.1 ... Why Did We Write This Book? ... 31
1.2 ... What Does This Book Provide? ... 32
1.3 ... Structure of the Book ... 32
1.4 ... How Should You Read This Book? ... 33
1.5 ... Sample Programs ... 34
1.6 ... Preface to the Second English Edition (2026) ... 34
1.7 ... Acknowledgments ... 35
2 ... The Python Programming Language ... 37
2.1 ... History and Origin ... 37
2.2 ... Basic Concepts ... 38
2.3 ... Possible Areas of Use and Strengths ... 39
2.4 ... Installing Python ... 40
2.5 ... Installing Third-Party Modules ... 43
2.6 ... Using Python ... 43
PART I ... Getting Started with Python ... 45
3 ... Getting Started with the Interactive Mode ... 47
3.1 ... Integers ... 47
3.2 ... Floats ... 49
3.3 ... Character Strings ... 49
3.4 ... Lists ... 50
3.5 ... Dictionaries ... 51
3.6 ... Variables ... 52
3.7 ... Logical Expressions ... 53
3.8 ... Functions and Methods ... 55
3.9 ... Screen Outputs ... 57
3.10 ... Modules ... 58
4 ... The Path to the First Program ... 61
4.1 ... Typing, Compiling, and Testing ... 61
4.2 ... Basic Structure of a Python Program ... 64
4.3 ... The First Program ... 67
4.4 ... Comments ... 69
4.5 ... In Case of Error ... 70
5 ... Control Structures ... 73
5.1 ... Conditionals ... 73
5.2 ... Loops ... 77
5.3 ... The pass Statement ... 84
5.4 ... Assignment Expressions ... 84
6 ... Files ... 89
6.1 ... Data Streams ... 89
6.2 ... Reading Data from a File ... 90
6.3 ... Writing Data to a File ... 94
6.4 ... Generating the File Object ... 95
7 ... The Data Model ... 101
7.1 ... The Structure of Instances ... 103
7.2 ... Deleting References ... 107
7.3 ... Mutable Versus Immutable Data Types ... 109
8 ... Functions, Methods, and Attributes ... 113
8.1 ... Parameters of Functions and Methods ... 113
8.2 ... Attributes ... 116
9 ... Sources of Information on Python ... 117
9.1 ... The Built-In Help Function ... 117
9.2 ... The Online Documentation ... 118
9.3 ... PEPs ... 118
PART II ... Data Types ... 121
10 ... Basic Data Types: An Overview ... 123
10.1 ... Nothingness: NoneType ... 124
10.2 ... Operators ... 125
11 ... Numeric Data Types ... 129
11.1 ... Arithmetic Operators ... 129
11.2 ... Comparison Operators ... 131
11.3 ... Conversion between Numeric Data Types ... 132
11.4 ... Integers: int ... 133
11.5 ... Floats: float ... 139
11.6 ... Boolean Values: bool ... 142
11.7 ... Complex Numbers: complex ... 147
12 ... Sequential Data Types ... 151
12.1 ... The Difference Between Text and Binary Data ... 151
12.2 ... Operations on Instances of Sequential Data Types ... 152
12.3 ... The list Data Type ... 164
12.4 ... Immutable Lists: tuple ... 177
12.5 ... Strings: str, bytes, bytearray ... 180
13 ... Mappings and Sets ... 217
13.1 ... Dictionary: dict ... 217
13.2 ... Sets: set and frozenset ... 229
14 ... Collections ... 243
14.1 ... Chained Dictionaries ... 243
14.2 ... Counting Frequencies ... 244
14.3 ... Dictionaries with Default Values ... 246
14.4 ... Doubly Linked Lists ... 247
14.5 ... Named Tuples ... 249
15 ... Date and Time ... 251
15.1 ... Elementary Time Functions: time ... 251
15.2 ... Object-Oriented Date Management: datetime ... 259
15.3 ... Time Zones: zoneinfo ... 268
16 ... Enumerations and Flags ... 273
16.1 ... Enumeration Types: enum ... 273
16.2 ... Enumeration Types for Bit Patterns: Flag ... 275
16.3 ... Integer Enumeration Types: IntEnum ... 276
PART III ... Advanced Programming Techniques ... 277
17 ... Functions ... 279
17.1 ... Defining a Function ... 280
17.2 ... Return Values ... 282
17.3 ... Function Objects ... 284
17.4 ... Optional Parameters ... 284
17.5 ... Keyword Arguments ... 285
17.6 ... Arbitrarily Many Parameters ... 286
17.7 ... Keyword-Only Parameters ... 288
17.8 ... Positional-Only Parameters ... 289
17.9 ... Unpacking When Calling a Function ... 290
17.10 ... Side Effects ... 293
17.11 ... Namespaces ... 295
17.12 ... Anonymous Functions ... 301
17.13 ... Recursion ... 302
17.14 ... Built-In Functions ... 303
18 ... Modules and Packages ... 327
18.1 ... Importing Global Modules ... 328
18.2 ... Local Modules ... 330
18.3 ... Packages ... 332
18.4 ... The importlib Package ... 336
18.5 ... Planned Language Elements ... 337
19 ... Object-Oriented Programming ... 339
19.1 ... Example: A Non-Object-Oriented Account ... 339
19.2 ... Classes ... 344
19.3 ... Inheritance ... 349
19.4 ... Multiple Inheritance ... 361
19.5 ... Property Attributes ... 363
19.6 ... Static Methods ... 365
19.7 ... Class Methods ... 367
19.8 ... Class Attributes ... 368
19.9 ... Built-in Functions for Object-Oriented Programming ... 369
19.10 ... Inheriting Built-In Data Types ... 372
19.11 ... Magic Methods and Magic Attributes ... 374
19.12 ... Data Classes ... 393
20 ... Exception Handling ... 399
20.1 ... Exceptions ... 399
20.2 ... Assertions ... 414
20.3 ... Warnings ... 415
20.4 ... Exception Groups ... 416
21 ... Generators and Iterators ... 421
21.1 ... Generators ... 421
21.2 ... Iterators ... 428
21.3 ... Special Generators: itertools ... 437
21.4 ... Generators as Consumers ... 446
22 ... Context Manager ... 453
22.1 ... The with Statement ... 453
22.2 ... Helper Functions for with Contexts: contextlib ... 456
23 ... Decorators ... 461
23.1 ... Function Decorators ... 461
23.2 ... Class Decorators ... 466
23.3 ... The functools Module ... 467
24 ... Annotations for Static Type Checking ... 473
24.1 ... Annotations ... 474
24.2 ... Type Hints: The typing Module ... 481
24.3 ... Static Type Checking in Python: mypy ... 487
25 ... Structural Pattern Matching ... 489
25.1 ... The match Statement ... 489
25.2 ... Pattern Types in the case Statement ... 490
PART IV ... The Standard Library ... 505
26 ... Mathematics ... 507
26.1 ... Mathematical Functions: math, cmath ... 507
26.2 ... Random Number Generator: random ... 513
26…
