Inhalt
1.1 ... Advantages of Python ... 21
1.2 ... Prevalence of Python ... 22
1.3 ... Structure of This Book ... 22
1.4 ... Exercises ... 23
1.5 ... Installation on Windows ... 23
1.6 ... Installation on Ubuntu Linux ... 24
1.7 ... Installation on macOS ... 25
2.1 ... Python as a Calculator ... 27
2.2 ... Our First Program ... 31
2.3 ... Saving and Running ... 32
3.1 ... Programming a Game ... 37
3.2 ... Variables and Operators ... 38
3.3 ... Branches ... 44
3.4 ... Loops ... 57
3.5 ... Developing a Program ... 69
3.6 ... Errors and Exceptions ... 69
3.7 ... Functions and Modules ... 74
3.8 ... Type Hints ... 80
3.9 ... The Finished Game ... 84
4.1 ... Numbers ... 89
4.2 ... Character Strings ... 106
4.3 ... Lists ... 115
4.4 ... Tuples ... 122
4.5 ... Dictionaries ... 124
4.6 ... Sets ... 127
4.7 ... Truth Values and Nothing ... 130
4.8 ... Reference, Identity, and Copy ... 133
4.9 ... Type Hints ... 136
5.1 ... General Remarks ... 139
5.2 ... Output and Formatting ... 143
5.3 ... Functions for Iterables ... 147
5.4 ... Encryption ... 151
5.5 ... Errors and Exceptions ... 153
5.6 ... Functions ... 160
5.7 ... Built-In Functions ... 169
5.8 ... Other Mathematical Modules ... 173
5.9 ... Custom Modules ... 186
5.10 ... Command Line Parameters ... 188
5.11 ... “Fractions Training” Program ... 189
6.1 ... Basic Principles ... 195
6.2 ... Advanced Topics ... 209
7.1 ... Date and Time ... 219
7.2 ... Queues ... 231
7.3 ... Multithreading ... 236
7.4 ... Regular Expressions ... 241
7.5 ... Audio Output ... 246
8.1 ... Opening and Closing a File ... 247
8.2 ... Text Files ... 248
8.3 ... Files with a Defined Structure ... 255
8.4 ... Serialization Using pickle ... 258
8.5 ... Data Exchange Using JSON ... 261
8.6 ... Editing Multiple Files ... 264
8.7 ... Information about Files ... 266
8.8 ... Managing Files and Directories ... 266
8.9 ... The Morse Code Sample Project ... 268
8.10 ... Our Game: Version with Highscore File ... 271
8.11 ... Our Game: Object-Oriented Version with Highscore File ... 276
9.1 ... Structure of Databases ... 281
9.2 ... SQLite ... 282
9.3 ... MySQL ... 295
9.4 ... Our Game: Version with Highscore Database ... 299
9.5 ... Our Game: Object-Oriented Version with Highscore Database ... 301
10.1 ... Introduction ... 303
10.2 ... Widget Types ... 308
10.3 ... Images and Mouse Events ... 326
10.4 ... The place Geometry Manager ... 332
10.5 ... Menus and Dialog Boxes ... 337
10.6 ... Drawings and Animations ... 346
10.7 ... Our Game: GUI Version ... 353
10.8 ... Exercise ... 358
11.1 ... Introduction ... 361
11.2 ... Widget Types ... 366
11.3 ... PyQt and SQLite ... 397
11.4 ... Exercise ... 409
A ... Miscellaneous Topics ... 411
B ... The Author ... 419