Python 3

The Comprehensive Guide
Langbeschreibung
Ready to master Python? 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 using Django and working with GUIs. With plenty of code examples throughout, this hands-on reference guide has everything you need to become proficient in Python!Highlights include:1) Functions2) Methods3) Attributes4) Data types5) GUIs6) Debugging7) Network communication8) Modularization9) Object orientation10) Iterators11) Generators12) Exception handling
Hauptbeschreibung
Consult and download practical code examples
Inhaltsverzeichnis
1 ... Introduction ... 331.1 ... Why Did We Write This Book? ... 331.2 ... What Does This Book Provide? ... 341.3 ... Structure of the Book ... 341.4 ... How Should You Read This Book? ... 351.5 ... Sample Programs ... 361.6 ... Preface To the First English Edition (2022) ... 361.7 ... Acknowledgments ... 372 ... The Python Programming Language ... 392.1 ... History, Concepts, and Areas of Application ... 392.2 ... Installing Python ... 422.3 ... Installing Third-Party Modules ... 452.4 ... Using Python ... 45PART I ... Getting Started with Python ... 473 ... Getting Started with the Interactive Mode ... 493.1 ... Integers ... 493.2 ... Floats ... 513.3 ... Character Strings ... 513.4 ... Lists ... 523.5 ... Dictionaries ... 533.6 ... Variables ... 543.7 ... Logical Expressions ... 553.8 ... Functions and Methods ... 573.9 ... Screen Outputs ... 593.10 ... Modules ... 604 ... The Path to the First Program ... 634.1 ... Typing, Compiling, and Testing ... 634.2 ... Basic Structure of a Python Program ... 664.3 ... The First Program ... 704.4 ... Comments ... 724.5 ... In Case of Error ... 725 ... Control Structures ... 755.1 ... Conditionals ... 755.2 ... Loops ... 795.3 ... The pass Statement ... 875.4 ... Assignment Expressions ... 876 ... Files ... 916.1 ... Data Streams ... 916.2 ... Reading Data from a File ... 926.3 ... Writing Data to a File ... 966.4 ... Generating the File Object ... 977 ... The Data Model ... 1037.1 ... The Structure of Instances ... 1057.2 ... Deleting References ... 1097.3 ... Mutable versus Immutable Data Types ... 1118 ... Functions, Methods, and Attributes ... 1158.1 ... Parameters of Functions and Methods ... 1158.2 ... Attributes ... 1189 ... Sources of Information on Python ... 1199.1 ... The Built-In Help Function ... 1199.2 ... The Online Documentation ... 1209.3 ... PEPs ... 120PART II ... Data Types ... 12310 ... Basic Data Types: An Overview ... 12510.1 ... Nothingness: NoneType ... 12610.2 ... Operators ... 12711 ... Numeric Data Types ... 13111.1 ... Arithmetic Operators ... 13111.2 ... Comparison Operators ... 13311.3 ... Conversion between Numeric Data Types ... 13411.4 ... Integers: int ... 13511.5 ... Floats: float ... 14111.6 ... Boolean Values: bool ... 14411.7 ... Complex Numbers: complex ... 14912 ... Sequential Data Types ... 15312.1 ... The Difference between Text and Binary Data ... 15312.2 ... Operations on Instances of Sequential Data Types ... 15412.3 ... The list Data Type ... 16612.4 ... Immutable Lists: tuple ... 17912.5 ... Strings: str, bytes, bytearray ... 18213 ... Mappings and Sets ... 21513.1 ... Dictionary: dict ... 21513.2 ... Sets: set and frozenset ... 22714 ... Collections ... 23914.1 ... Chained Dictionaries ... 23914.2 ... Counting Frequencies ... 24014.3 ... Dictionaries with Default Values ... 24214.4 ... Doubly Linked Lists ... 24314.5 ... Named Tuples ... 24515 ... Date and Time ... 24715.1 ... Elementary Time Functions¿time ... 24715.2 ... Object-Oriented Date Management: datetime ... 25415.3 ... Time Zones: zoneinfo ... 26316 ... Enumerations and Flags ... 26916.1 ... Enumeration Types: enum ... 26916.2 ... Enumeration Types for Bit Patterns: flag ... 27116.3 ... Integer Enumeration Types: IntEnum ... 272PART III ... Advanced Programming Techniques ... 27517 ... Functions ... 27717.1 ... Defining a Function ... 27817.2 ... Return Values ... 28017.3 ... Function Objects ... 28217.4 ... Optional Parameters ... 28217.5 ... Keyword Arguments ... 28317.6 ... Arbitrarily Many Parameters ... 28417.7 ... Keyword-Only Parameters ... 28617.8 ... Positional-Only Parameters ... 28717.9 ... Unpacking When Calling a Function ... 28817.10 ... Side Effects ... 29017.11 ... Namespaces ... 29317.12 ... Anonymous Functions ... 29917.13 ... Recursion ... 30017.14 ... Built-In Functions ... 30018 ... Modules and Packages ... 32518.1 ... Importing Global Modules ... 32618.2 ... Local Modules ... 32818.3 ... Packages ... 33118.4 ... The importlib Package ... 33518.5 ... Planned Language Elements ... 33819 ... Object-Oriented Programming ... 34119.1 ... Example: A Non-Object-Oriented Account ... 34119.2 ... Classes ... 34619.3 ... Inheritance ... 35119.4 ... Multiple Inheritance ... 36319.5 ... Property Attributes ... 36519.6 ... Static Methods ... 36719.7 ... Class Methods ... 36919.8 ... Class Attributes ... 37019.9 ... Built-in Functions for Object-Oriented Programming ... 37019.10 ... Inheriting Built-In Data Types ... 37319.11 ... Magic Methods and Magic Attributes ... 37519.12 ... Data Classes ... 39320 ... Exception Handling ... 39920.1 ... Exceptions ... 39920.2 ... Assertions ... 41120.3 ... Warnings ... 41221 ... Generators and Iterators ... 41521.1 ... Generators ... 41521.2 ... Iterators ... 42221.3 ... Special Generators: itertools ... 43222 ... Context Manager ... 44122.1 ... The with Statement ... 44122.2 ... Helper Functions for with Contexts: contextlib ... 44423 ... Decorators ... 44923.1 ... Function Decorators ... 44923.2 ... Class Decorators ... 45423.3 ... The functools Module ... 45524 ... Annotations for Static Type Checking ... 46324.1 ... Annotations ... 46424.2 ... Type Hints: The typing Module ... 47124.3 ... Static Type Checking in Python: mypy ... 47625 ... Structural Pattern Matching ... 47925.1 ... The match Statement ... 47925.2 ... Pattern Types in the case Statement ... 480PART IV ... The Standard Library ... 49526 ... Mathematics ... 49726.1 ... Mathematical Functions: math, cmath ... 49726.2 ... Random Number Generator: random ... 50326.3 ... Statistical Calculations: statistics ... 50726.4 ... Intuitive Decimal Numbers: decimal ... 50926.5 ... Hash Functions: hashlib ... 51427 ... Screen Outputs and Logging ... 52127.1 ... Formatted Output of Complex Objects: pprint ... 52127.2 ... Log Files: logging ... 52328 ... Regular Expressions ... 52928.1 ... Syntax of Regular Expressions ... 52928.2 ... Using the re Module ... 53928.3 ... A Simple Sample Program: Searching ... 54628.4 ... A More Complex Sample Program: Matching ... 54728.5 ... Comments in Regular Expressions ... 55029 ... Interface to Operating System and Runtime Environment ... 55329.1 ... Operating System Functionality: os ... 55329.2 ... Accessing the Runtime Environment: sys ... 55529.3 ... Command Line Parameters: argparse ... 56130 ... File System ... 56930.1 ... Accessing the File System: os ... 56930.2 ... File Paths: os.path ... 57530.3 ... Accessing the File System: shutil ... 57930.4 ... Temporary Files: tempfile ... 58531 ... Parallel Programming ... 58731.1 ... Processes, Multitasking, and Threads ... 58731.2 ... Python's Interfaces for Parallelization ... 59131.3 ... The Abstract Interface: concurrent.futures ... 59231.4 ... The Flexible Interface: threading and multiprocessing ... 60231.5 ... Cooperative Multitasking ... 61331.6 ... Conclusion: Which Interface Is the Right One? ... 62932 ... Data Storage ... 63132.1 ... XML ... 63132.2 ... Databases ... 64332.3 ... Compressed Files and Archives ... 66132.4 ... Serializing Instances: pickle ... 66232.5 ... The JSON Data Exchange Format: json ... 66532.6 ... The CSV Table Format: csv ... 66733 ... Network Communication ... 67333.1 ... Socket API ... 67433.2 ... XML-RPC ... 69034 ... Accessing Resources on the Internet ... 70134.1 ... Protocols ... 70134.2 ... Solutions ... 70234.3 ... The Easy Way: requests ... 70334.4 ... URLs: urllib ... 70534.5 ... FTP: ftplib ... 71335 ... Email ... 72135.1 ... SMTP: smtplib ... 72135.2 ... POP3: poplib ... 72435.3 ... IMAP4: imaplib ... 72835.4 ... Creating Complex Emails: email ... 73436 ... Debugging and Quality Assurance ... 73936.1 ... The Debugger ... 73936.2 ... Automated Testing ... 74136.3 ... Analyzing the Runtime Performance ... 74937 ... Documentation ... 75937.1 ... Docstrings ... 75937.2 ... Automatically Generated Documentation: pydoc ... 761PART V ... Advanced Topics ... 76338 ... Distributing Python Projects ... 76538.1 ... A History of Distributions in Python ... 76538.2 ... Creating Distributions: setuptools ... 76738.3 ... Creating EXE files: cx_Freeze ... 77538.4 ... Package Manager ... 77638.5 ... Localizing Programs: gettext ... 78139 ... Virtual Environments ... 78539.1 ... Using Virtual Environments: venv ... 78639.2 ... Virtual Environments in Anaconda ... 78740 ... Alternative Interpreters and Compilers ... 78940.1 ... Just-in-Time Compilation: PyPy ... 78940.2 ... Numba ... 79040.3 ... Connecting to C and C++: Cython ... 79340.4 ... The Interactive Python Shell: IPython ... 79941 ... Graphical User Interfaces ... 80541.1 ... Toolkits ... 80541.2 ... Introduction to tkinter ... 80741.3 ... Introduction to PySide6 ... 85041.4 ... Signals and Slots ... 85941.5 ... Important Widgets ... 86141.6 ... Drawing Functionality ... 86841.7 ... Model-View Architecture ... 87942 ... Python as a Server-Side Programming Language on the Web: An Introduction to Django ... 89342.1 ... Concepts and Features of Django ... 89442.2 ... Installing Django ... 89542.3 ... Creating a New Django Project ... 89642.4 ... Creating an Application ... 90043 ... Scientific Computing and Data Science ... 93543.1 ... Installation ... 93643.2 ... The Model Program ... 93643.3 ... Overview of the numpy and scipy Modules ... 94443.4 ... An Introduction to Data Analysis with pandas ... 95344 ... Inside Knowledge ... 96944.1 ... Opening URLs in the Default Browser: webbrowser ... 96944.2 ... Interpreting Binary Data: struct ... 96944.3 ... Hidden Password Entry ... 97144.4 ... Command Line Interpreter ... 97244.5 ... File Interface for Strings: io.StringIO ... 97544.6 ... Generators as Consumers ... 97644.7 ... Copying Instances: copy ... 98144.8 ... Image Processing: Pillow ... 98445 ... From Python 2 to Python 3 ... 99345.1 ... The Main Differences ... 99645.2 ... Automatic Conversion ... 1001... Appendices ... 1005A ... Appendix ... 1005B ... The Authors ... 1017... Index ... 1019
ISBN-13:
9781493223022
Veröffentl:
2023
Erscheinungsdatum:
03.02.2023
Seiten:
1036
Autor:
Johannes Ernesti
Gewicht:
1774 g
Format:
257x182x52 mm
Serie:
Rheinwerk Computing
Sprache:
Englisch

59,95 €*

Lieferzeit: Sofort lieferbari
Alle Preise inkl. MwSt. | zzgl. Versand