Python guides
Every published Python guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Python guides
Most readLatest Python guides
Page 55 of 179Python Requests Timeout Exception Handling and raise_for_status
Set connect and read timeouts in Python requests, catch Timeout exceptions, and use raise_for_status() to handle HTTP error statuses. Includes retry and logging examples.
Python Requests: Reading Response Text, JSON, Headers, and Status Codes
Learn how to use Python requests to read response text, parse JSON, inspect headers, and handle status codes.
Python Requests Authentication: Bearer Token, API Key, and Basic Auth
Learn how to authenticate Python requests calls using basic auth, bearer tokens, and API keys. Includes practical code examples, error handling, and security considerations.
Python Requests: Query Parameters, Headers, and JSON Body
Learn how to send query parameters, custom headers, and JSON bodies with Python requests, including how to combine them in one request and avoid common API client mistakes.
Python Requests: GET, POST, PUT, PATCH, DELETE
Use the Python requests library for GET, POST, PUT, PATCH, and DELETE HTTP methods, including JSON and form data, timeouts, sessions, and retry policies.
Python contextvars vs Thread Local: Which to Use?
Compare Python's contextvars and thread-local storage for passing context across threads and async tasks. Understand propagation, isolation, and when each fits.
Python Coroutine vs Future: Key Differences
python coroutine vs future: Understand the difference between Python coroutines and futures, how they work together in asyncio, and when to use each for efficient asyn...
Python create_task vs await: Key Differences
Understand when to use asyncio.create_task versus await in Python, including scheduling behavior, error handling, and common async I/O patterns.
Python gather vs wait: Choosing the Right asyncio API
python gather vs wait: Compare asyncio.gather and asyncio.wait: ordered results, error propagation, cancellation, completion policies, and when to use each.
Python gather vs TaskGroup: Choosing the Right Concurrency API
Compare asyncio.gather and asyncio.TaskGroup in Python: error propagation, cancellation, and when to use each for structured concurrency.