Lýsing:
Python was recently ranked as today's most popular programming language on the TIOBE index, thanks to its broad applicability to design and prototyping to testing, deployment, and maintenance. With this updated fourth edition, you'll learn how to get the most out of Python, whether you're a professional programmer or someone who needs this language to solve problems in a particular field. Carefully curated by recognized experts in Python, this new edition focuses on version 3.
10, bringing this seminal work on the Python language fully up to date on five version releases, including preview coverage of upcoming 3. 11 features. This handy guide will help you: Learn how Python represents data and program as objects Understand the value and uses of type annotations Examine which language features appeared in which recent versions Discover how to use modern Python idiomatically Learn ways to structure Python projects appropriately Understand how to debug Python code.
Annað
- Höfundar: Alex Martelli, Anna Martelli Ravenscroft, Steve Holden, Paul McGuire
- Útgáfa:4
- Útgáfudagur: 2023-01-09
- Engar takmarkanir á útprentun
- Engar takmarkanir afritun
- Format:ePub
- ISBN 13: 9781098113513
- Print ISBN: 9781098113551
- ISBN 10: 1098113519
Efnisyfirlit
- Preface
- How To Use This Book
- Part I, Getting Started with Python
- Part II, Core Python Language and Built-ins
- Part III, Python Library and Extension Modules
- Part IV, Network and Web Programming
- Part V, Extending, Distributing, and Version Upgrade and Migration
- Conventions Used in This Book
- Reference Conventions
- Version Conventions
- Typographic Conventions
- Using Code Examples
- O’Reilly Online Learning
- How to Contact Us
- Acknowledgments
- How To Use This Book
- 1. Introduction to Python
- The Python Language
- The Python Standard Library and Extension Modules
- Python Implementations
- CPython
- PyPy
- Choosing Between CPython, PyPy, and Other Implementations
- Other Developments, Implementations, and Distributions
- Licensing and Price Issues
- Python Development and Versions
- Python Resources
- Documentation
- Community
- Installation
- Installing Python from Binaries
- Installing Python from Source Code
- Microsoft Windows
- Unix-Like Platforms
- The python Program
- Environment Variables
- Command-Line Syntax and Options
- The Windows py Launcher
- The PyPy Interpreter
- Interactive Sessions
- Python Development Environments
- IDLE
- Other Python IDEs
- Free Text Editors with Python Support
- Tools for Checking Python Programs
- Running Python Programs
- Running Python in the Browser
- PyScript
- Jupyter
- Lexical Structure
- Lines and Indentation
- Character Sets
- Tokens
- Statements
- Data Types
- Numbers
- Sequences
- Sets
- Dictionaries
- None
- Ellipsis (...)
- Callables
- Boolean Values
- Variables and Other References
- Variables
- Assignment Statements
- del Statements
- Expressions and Operators
- Comparison Chaining
- Short-Circuiting Operators
- Assignment Expressions
- Numeric Operations
- Numeric Conversions
- Arithmetic Operations
- Bitwise Operations on Integers
- Sequence Operations
- Sequences in General
- Strings
- Tuples
- Lists
- Set Operations
- Set Membership
- Set Methods
- Dictionary Operations
- Dictionary Membership
- Indexing a Dictionary
- Dictionary Methods
- Control Flow Statements
- The if Statement
- The match Statement
- The while Statement
- The for Statement
- The break Statement
- The continue Statement
- The else Clause on Loop Statements
- The pass Statement
- The try and raise Statements
- The with Statement
- Functions
- Defining Functions: The def Statement
- Parameters
- Attributes of Function Objects
- Function Annotations
- The return Statement
- Calling Functions
- Namespaces
- lambda Expressions
- Generators
- Recursion
- Classes and Instances
- Python Classes
- The class Statement
- The Class Body
- Descriptors
- Instances
- Attribute Reference Basics
- Bound and Unbound Methods
- Inheritance
- The Built-in object Type
- Class-Level Methods
- Properties
- __slots__
- __getattribute__
- Per Instance Methods
- Inheritance from Built-in Types
- Special Methods
- General-Purpose Special Methods
- Special Methods for Containers
- Abstract Base Classes
- Special Methods for Numeric Objects
- Decorators
- Metaclasses
- Alternatives to Custom Metaclasses for Simple Class Customization
- How Python Determines a Class’s Metaclass
- How a Metaclass Creates a Class
- Data Classes
- Enumerated Types (Enums)
- History
- Type-Checking Utilities
- mypy
- Other Type Checkers
- Type Annotation Syntax
- The typing Module
- Types
- Type Expression Parameters
- Abstract Base Classes
- Protocols
- Utilities and Decorators
- Defining Custom Types
- Using Type Annotations at Runtime
- How to Add Type Annotations to Your Code
- Adding Type Annotations to New Code
- Adding Type Annotations to Existing Code (Gradual Typing)
- Using .pyi Stub Files
- Summary
- The try Statement
- try/except
- try/finally
- try/except/finally
- The raise Statement
- The with Statement and Context Managers
- Generators and Exceptions
- Exception Propagation
- Exception Objects
- The Hierarchy of Standard Exceptions
- Standard Exception Classes
- Custom Exception Classes
- Custom Exceptions and Multiple Inheritance
- Other Exceptions Used in the Standard Library
- ExceptionGroup and except*
- Error-Checking Strategies
- LBYL Versus EAFP
- Handling Errors in Large Programs
- Logging Errors
- The assert Statement
- Module Objects
- The import Statement
- The from Statement
- Module Loading
- Built-in Modules
- Searching the Filesystem for a Module
- The Main Program
- Reloading Modules
- Circular Imports
- Custom Importers
- Packages
- Special Attributes of Package Objects
- Absolute Versus Relative Imports
- Distribution Utilities (distutils) and setuptools
- Python Environments
- Enter the Virtual Environment
- What Is a Virtual Environment?
- Creating and Deleting Virtual Environments
- Working with Virtual Environments
- Managing Dependency Requirements
- Other Environment Management Solutions
- Best Practices with Virtualenvs
- Built-in Types
- Built-in Functions
- The sys Module
- The copy Module
- The collections Module
- ChainMap
- Counter
- OrderedDict
- defaultdict
- deque
- The functools Module
- The heapq Module
- The Decorate–Sort–Undecorate Idiom
- The argparse Module
- The itertools Module
- Methods of String Objects
- The string Module
- String Formatting
- Formatted String Literals (F-Strings)
- Formatting Using format Calls
- Value Conversion
- Value Formatting: The Format Specifier
- Nested Format Specifications
- Formatting of User-Coded Classes
- Legacy String Formatting with %
- Format Specifier Syntax
- Text Wrapping and Filling
- The pprint Module
- The reprlib Module
- Unicode
- The codecs Module
- The unicodedata Module
- Regular Expressions and the re Module
- REs and bytes Versus str
- Pattern String Syntax
- Common Regular Expression Idioms
- Sets of Characters
- Alternatives
- Groups
- Optional Flags
- Match Versus Search
- Anchoring at String Start and End
- Regular Expression Objects
- Match Objects
- Functions of the re Module
- REs and the := Operator
- The Third-Party regex Module
- The io Module
- Creating a File Object with open
- Attributes and Methods of File Objects
- Iteration on File Objects
- File-Like Objects and Polymorphism
- The tempfile Module
- Auxiliary Modules for File I/O
- The fileinput Module
- The struct Module
- In-Memory Files: io.StringIO and io.BytesIO
- Archived and Compressed Files
- The tarfile Module
- The zipfile Module
- The os Module
- Filesystem Operations
- The os.path Module
- OSError Exceptions
- The errno Module
- The pathlib Module
- The stat Module
- The filecmp Module
- The fnmatch Module
- The glob Module
- The shutil Module
- Text Input and Output
- Standard Output and Standard Error
- The print Function
- Standard Input
- The getpass Module
- Richer-Text I/O
- The readline Module
- Console I/O
- Internationalization
- The locale Module
- The gettext Module
- More Internationalization Resources
- Serialization
- The csv Module
- The json Module
- The pickle Module
- The shelve Module
- DBM Modules
- The dbm Package
- Examples of DBM-Like File Use
- The Python Database API (DBAPI)
- Exception Classes
- Thread Safety
- Parameter Style
- Factory Functions
- Type Description Attributes
- The connect Function
- Connection Objects
- Cursor Objects
- DBAPI-Compliant Modules
- SQLite
- The time Module
- The datetime Module
- The date Class
- The time Class
- The datetime Class
- The timedelta Class
- The tzinfo Abstract Class
- The timezone Class
- The zoneinfo Module
- The dateutil Module
- The sched Module
- The calendar Module
- Per-Site Customization
- Termination Functions
- Dynamic Execution and exec
- Avoiding exec
- Expressions
- compile and Code Objects
- Never exec or eval Untrusted Code
- Internal Types
- Type Objects
- The Code Object Type
- The Frame Type
- Garbage Collection
- The gc Module
- The weakref Module
- Threads in Python
- The threading Module
- Thread Objects
- Thread Synchronization Objects
- Thread Local Storage
- The queue Module
- The multiprocessing Module
- Differences Between multiprocessing and threading
- Sharing State: Classes Value, Array, and Manager
- Process Pools
- The concurrent.futures Module
- Threaded Program Architecture
- Process Environment
- Running Other Programs
- Using the Subprocess Module
- Running Other Programs with the os Module
- The mmap Module
- Methods of mmap Objects
- Using mmap Objects for IPC
- Floating-Point Values
- The math and cmath Modules
- The statistics Module
- The operator Module
- Random and Pseudorandom Numbers
- The random Module
- Crypto-Quality Random Numbers: The secrets Module
- The fractions Module
- The decimal Module
- Array Processing
- The array Module
- Extensions for Numeric Array Computation
- Testing
- Unit Testing and System Testing
- The doctest Module
- The unittest Module
- Testing with nose2
- Testing with pytest
- Debugging
- Before You Debug
- The inspect Module
- The traceback Module
- The pdb Module
- Other Debugging Modules
- The warnings Module
- Classes
- Objects
- Filters
- Functions
- Optimization
- Developing a Fast-Enough Python Application
- Benchmarking
- Large-Scale Optimization
- Profiling
- Small-Scale Optimization
- The Berkeley Socket Interface
- Socket Addresses
- Client/Server Computing
- The socket Module
- Socket Objects
- A Connectionless Socket Client
- A Connectionless Socket Server
- A Connection-Oriented Socket Client
- A Connection-Oriented Socket Server
- Transport Layer Security
- SSLContext
- Email Protocols
- The poplib Module
- The smtplib Module
- HTTP and URL Clients
- URL Access
- The urllib Package
- The Third-Party requests Package
- Other Network Protocols
- http.server
- WSGI
- WSGI Servers
- ASGI
- Python Web Frameworks
- “Full-Stack” Versus “Lightweight” Frameworks
- A Few Popular Full-Stack Frameworks
- Considerations When Using Lightweight Frameworks
- A Few Popular Lightweight Frameworks
- MIME and Email Format Handling
- Functions in the email Package
- The email.message Module
- The email.Generator Module
- Creating Messages
- The email.encoders Module
- The email.utils Module
- Example Uses of the email Package
- Encoding Binary Data as ASCII Text
- The base64 Module
- The quopri Module
- The uu Module
- The html.entities Module
- The BeautifulSoup Third-Party Package
- The BeautifulSoup Class
- The Navigable Classes of bs4
- bs4 find… Methods (aka Search Methods)
- bs4 CSS Selectors
- An HTML Parsing Example with BeautifulSoup
- Generating HTML
- Editing and Creating HTML with bs4
- Building HTML with bs4
- Templating
- The jinja2 Package
- ElementTree
- The Element Class
- The ElementTree Class
- Functions in the ElementTree Module
- Parsing XML with ElementTree.parse
- Selecting Elements from an ElementTree
- Editing an ElementTree
- Building an ElementTree from Scratch
- Parsing XML Iteratively
- What We Don’t Cover in This Chapter
- A Brief History of Python Packaging
- Online Material
- Online Material
- Significant Changes in Python Through 3.11
- Planning a Python Version Upgrade
- Choosing a Target Version
- Scoping the Work
- Applying the Code Changes
- Upgrade Automation Using pyupgrade
- Multiversion Testing
- Use a Controlled Deployment Process
- How Often Should You Upgrade?
- Summary
- Python 3.7
- Python 3.8
- Python 3.9
- Python 3.10
- Python 3.11
UM RAFBÆKUR Á HEIMKAUP.IS
Bókahillan þín er þitt svæði og þar eru bækurnar þínar geymdar. Þú kemst í bókahilluna þína hvar og hvenær sem er í tölvu eða snjalltæki. Einfalt og þægilegt!Rafbók til eignar
Rafbók til eignar þarf að hlaða niður á þau tæki sem þú vilt nota innan eins árs frá því bókin er keypt.
Þú kemst í bækurnar hvar sem er
Þú getur nálgast allar raf(skóla)bækurnar þínar á einu augabragði, hvar og hvenær sem er í bókahillunni þinni. Engin taska, enginn kyndill og ekkert vesen (hvað þá yfirvigt).
Auðvelt að fletta og leita
Þú getur flakkað milli síðna og kafla eins og þér hentar best og farið beint í ákveðna kafla úr efnisyfirlitinu. Í leitinni finnur þú orð, kafla eða síður í einum smelli.
Glósur og yfirstrikanir
Þú getur auðkennt textabrot með mismunandi litum og skrifað glósur að vild í rafbókina. Þú getur jafnvel séð glósur og yfirstrikanir hjá bekkjarsystkinum og kennara ef þeir leyfa það. Allt á einum stað.
Hvað viltu sjá? / Þú ræður hvernig síðan lítur út
Þú lagar síðuna að þínum þörfum. Stækkaðu eða minnkaðu myndir og texta með multi-level zoom til að sjá síðuna eins og þér hentar best í þínu námi.
Fleiri góðir kostir
- Þú getur prentað síður úr bókinni (innan þeirra marka sem útgefandinn setur)
- Möguleiki á tengingu við annað stafrænt og gagnvirkt efni, svo sem myndbönd eða spurningar úr efninu
- Auðvelt að afrita og líma efni/texta fyrir t.d. heimaverkefni eða ritgerðir
- Styður tækni sem hjálpar nemendum með sjón- eða heyrnarskerðingu
- Gerð : 208
- Höfundur : 16350
- Útgáfuár : 2023
- Leyfi : 379