Skip to content
Python Lore

Python Lore

The ultimate Python guide

  • Home
  • Home
Using Request Hooks for Event Handling in Requests
Posted inPython modules Requests

Using Request Hooks for Event Handling in Requests

Posted inPython modules, RequestsTags: Event Handling, Request Hooks, Requests
Python requests Session stateful hooks using a callable class. Maintain state across requests for API metrics, monitoring, and request/response lifecycle control.
Read More
Understanding math.tanh for Hyperbolic Tangent Function
Posted inmath Python modules

Understanding math.tanh for Hyperbolic Tangent Function

Posted inmath, Python modulesTags: Hyperbolic Tangent, math.tanh
Tanh activation function saturation and the vanishing gradient problem. Analysis of the tanh derivative in neural network backpropagation with Python code examples.
Read More
Customizing Scoring and Evaluation Metrics in scikit-learn
Posted inPython modules scikit-learn

Customizing Scoring and Evaluation Metrics in scikit-learn

Posted inPython modules, scikit-learnTags: Custom Scoring, Evaluation Metrics
The simple scorer you forged was a solid piece of work. It took y_true and y_pred and produced a number that meant something to the business. A fine tool. But some jobs require more specialized instruments. A simple comparison of...
Read More
Using datetime.datetime.now to Get Current Date and Time
Posted indatetime Python modules

Using datetime.datetime.now to Get Current Date and Time

Posted indatetime, Python modulesTags: Current Date Time, datetime.now
Python datetime timezone issues. Use aware objects with the zoneinfo module. Convert to UTC for storage to fix ambiguity and prevent TypeError when mixing datetimes.
Read More
Implementing Physics and Gravity in Pygame
Posted inPygame Python modules

Implementing Physics and Gravity in Pygame

Posted inPygame, Python modulesTags: Gravity, Physics, Pygame
Pygame time-based physics using delta time (dt) for frame rate independence. Decouple simulation from rendering for a robust, deterministic game update loop.
Read More
Understanding Blocking and Non-blocking Socket Operations
Posted inPython modules socket

Understanding Blocking and Non-blocking Socket Operations

Posted inPython modules, socketTags: Blocking, Non-blocking, Sockets
Python non-blocking sockets with setblocking(False). Handle BlockingIOError exceptions for responsive I/O. Avoid busy-wait loops and CPU polling with recv().
Read More
Zero-Width Assertions in Regular Expressions: Lookahead and Lookbehind
Posted inPython modules re

Zero-Width Assertions in Regular Expressions: Lookahead and Lookbehind

Posted inPython modules, reTags: Lookahead, Lookbehind, Zero-Width Assertions
Regex lookahead & lookbehind for string splitting. Use zero-width assertions with Python's re.split to split strings without consuming delimiters. Split camel case.
Read More
Customizing Matplotlib with Style Sheets
Posted inMatplotlib Python modules

Customizing Matplotlib with Style Sheets

Posted inMatplotlib, Python modulesTags: Style Sheets
Matplotlib plot customization with rcParams, style sheets, and the matplotlibrc file. Settings hierarchy from plt.style.use, context managers, to function arguments.
Read More
Identifying Thread Information with sys._current_frames
Posted inPython modules sys

Identifying Thread Information with sys._current_frames

Posted inPython modules, sysTags: sys._current_frames, Threads
Python's `sys._current_frames()` for thread stack traces. Walk the call stack with frame objects and `f_back` for live debugging, profiling, and monitoring applications.
Read More
Advanced Network Services with Python socket Module
Posted inPython modules socket

Advanced Network Services with Python socket Module

Posted inPython modules, socketTags: Advanced Network Services, Python socket
Resilient network server in Python using the selectors module. Failure isolation, non-blocking I/O, and robust error handling for multiple concurrent clients.
Read More

Posts pagination

1 2 3 … 44 Next page
Books
Python Programming for Beginners
Posted inBooks
Python Programming for Beginners
Murach's Python Programming
Posted inBooks
Murach’s Python Programming
Python Mastery
Posted inBooks
Python Mastery
Python for Beginners
Posted inBooks
Python for Beginners
Copyright 2023-2025 by Python Lore. All rights reserved.
Scroll to Top
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.