Tag: Python
39 posts
-
Python Task Scheduling | Automate Jobs with schedule
Schedule Python jobs with schedule and APScheduler: cron syntax, timezones, misfire handling, persistence, and multi-worker duplicate-run pitfalls.
-
Python asyncio in Practice: Event Loops, Async Context Managers, Concurrency Limits and Debugging
Use Python asyncio correctly: how the event loop runs coroutines, capping concurrency with Semaphore, async context managers, and when threads fit better.
-
How CPython Runs Your Code: Bytecode, the GIL, Reference Counting and the Import System
CPython architecture from AST to ceval, the GIL and concurrency trade-offs, refcount and generational GC, importlib and package rules, plus logging.
-
Running LLMs Locally with Ollama: Quantization Tags, num_ctx, GPU Offload and the API
Run LLMs locally with Ollama: what quantization tags mean, why num_ctx silently truncates prompts, GPU/CPU offload, the OpenAI-compatible API, and safe network exposure.
-
LangChain 1.x in Practice: LCEL Pipes, create_agent, RAG and When to Skip It
Current LangChain in Python: the package split, LCEL Runnables, memory that actually works, create_agent replacing AgentExecutor, a RAG chain, and when to skip it.
-
A Systematic Debugging Method: Reproduce, Isolate, Test a Hypothesis, and Read Stack Traces
A step-by-step debugging method (reproduce, isolate, test a hypothesis) plus stack traces, common JavaScript and Python errors, DevTools and Node.js debugging.
-
Finding Memory Leaks: Heap Snapshots in Node.js, tracemalloc in Python, Heap Dumps in Java
Tell a leak from high memory use, then find it with heap snapshots and Clinic.js in Node.js, tracemalloc in Python, and heap dumps and jstat on the JVM.
-
Building MCP Servers: Model Context Protocol Architecture, Python and TypeScript Servers, Claude Desktop
MCP (Model Context Protocol) is Anthropic's open standard for connecting AI models to external tools. How it is structured, building servers in Python and TypeScript, and connecting them to Claude Desktop.
-
Building on the Claude Messages API: max_tokens, Streaming, Tool Use Loops, Caching and Retries
Claude Messages API in production: required max_tokens, content blocks, streaming, the tool use loop, prompt caching, 429/529 retries and stop_reason values.
-
FastAPI in Production: Pydantic v2, async vs sync Endpoints, Dependency Injection and JWT
A practical FastAPI guide covering Pydantic v2 validation, async vs sync endpoint choice, dependency injection for testability, JWT auth, and the production gotchas each pattern glosses over.
-
Local Vector Search with ChromaDB: Embeddings, Queries, LangChain and a RAG Chatbot
Local vector search with ChromaDB 1.x: how embeddings and distances work, metadata filters, persistence traps, LangChain integration, and a minimal RAG chain.
-
pip vs uv vs Poetry: Install Speed, Lock Files and Virtual Environments Compared
Compare pip, uv, and Poetry based on installation speed, lock files, virtual environments, and pyproject.
-
Python Decorators: Writing @decorator Functions, Decorator Factories and functools.wraps
Write Python decorators for logging, caching, auth and retries, build decorator factories that take arguments, and keep metadata with functools.wraps.
-
Flask Basics | Get Started with the Python Web Framework
Start with Flask: routes, Jinja2 templates, forms, JSON APIs, sessions, SQLAlchemy and Blueprints, then deploy with Gunicorn and Docker and compare with FastAPI.
-
Django from Scratch: Models, Migrations, Views, URLs, Templates and the Admin
Learn Django from scratch: project layout, models, migrations, function and class-based views, URLs, templates, and the admin site—with runnable examples.
-
Python REST APIs | Build API Servers with Flask and Django
Design RESTful APIs in Python: HTTP verbs, resource URLs, Flask CRUD examples, Django REST Framework, JWT auth, error handling, and production-minded tips.
-
Python Databases | SQLite, PostgreSQL, and ORMs Explained
Work with databases in Python: sqlite3, SQLAlchemy models, CRUD, relationships, and a Flask + SQLAlchemy API example.
-
Deploying a Python Web App: Gunicorn, Docker, Heroku and EC2 with Nginx
Deploy Flask or Django to production: env config, Gunicorn workers and timeouts, Docker and Compose, Heroku, EC2 with Nginx and systemd, and 502 errors.
-
Pandas Basics: Series and DataFrames, Selecting, groupby and merge on Real Data
Pandas basics for Python: Series and DataFrame, I/O, filtering, groupby, merge, and real-world patterns.
-
NumPy Basics: Arrays, Broadcasting, Views vs Copies, and dtype Pitfalls
Learn NumPy by how it actually behaves: ndarray memory layout, vectorization, broadcasting rules with real errors, views vs copies, axis, and uint8 overflow.
-
Matplotlib Basics: Line, Bar, Histogram and Scatter Plots, Subplots and Report-Ready Styling
Matplotlib tutorial: line plots, bar charts, histograms, scatter, subplots, styling, and report-ready figures.
-
Data Preprocessing in Python: Missing Values, Outliers, Scaling and Encoding
Python data preprocessing: handle missing data, IQR/Z-score outliers, Min-Max and StandardScaler, categorical encoding.
-
Hands-on Data Analysis with Python | Pandas Workflows
Practical Python data analysis: load data, EDA with plots, groupby and pivot tables, time series with resample and rolling, correlation heatmaps.
-
Python File Automation | Organize, Rename, and Back Up Files
Automate file workflows in Python: find and rename files, organize by extension, backups with shutil, duplicate detection, and log cleanup.
-
Python Web Scraping | BeautifulSoup and Selenium Explained
Python web scraping tutorial: requests, BeautifulSoup for static HTML, Selenium for dynamic pages, ethics (robots.txt, rate limits), and CSV.
-
Optimizing a Slow Python CSV Job Step by Step, with Measured Timings
A measured walkthrough of a slow Python CSV job: reading cProfile correctly, hoisting loop invariants, NumPy vectorization, and why Pool made it slower.
-
Python list vs tuple vs set: Mutability, Duplicates, Big-O and Memory
Compare Python list, tuple, and set: ordering, duplicates, big-O operations, memory, and a decision flowchart for real code.
-
Setting Up Python: Installing Python 3, pip, venv, VS Code or PyCharm and a Clean Project Layout
Set up Python on Windows/Mac/Linux: install Python 3, pip, venv, VS Code, PyCharm, requirements.txt, Poetry, and a clean project layout for beginners.
-
Python Basic Syntax: Indentation Errors, Truthiness, Floor Division, f-strings and match
Python syntax that trips up newcomers: IndentationError and TabError, truthy values, chained comparisons, negative floor division, f-string specs and match.
-
Python Data Types Explained: Mutability, Aliasing, Float Rounding, is vs == and Truthiness
How Python data types really behave: names vs objects, list aliasing and copies, int vs float precision, round() and Decimal, str immutability, dicts, is vs ==.
-
Python Functions: Parameters, Defaults, Closures, and the Traps Behind Them
How Python functions really behave: positional-only and keyword-only parameters, the mutable default trap, late-binding closures, nonlocal, and functools.wraps.
-
Python Classes: Class vs Instance Attributes, super() and the MRO, @property and Dataclasses
How Python classes work: the shared mutable class attribute bug, __new__ vs __init__, super() and the MRO, @property, dataclasses and __hash__.
-
Python Modules and Packages: import, sys.path, pip and venv
Organize Python code into modules and packages: import styles, relative imports, __init__.py, pip, requirements.txt, venv and fixing ModuleNotFoundError.
-
Python File Handling | Read, Write, CSV, JSON, and pathlib
Learn Python file I/O: text files, CSV with csv module, JSON with json, pathlib paths, encoding, and the with statement—practical patterns included.
-
Python Exception Handling: try/except/else/finally, Raising Errors and Custom Exceptions
Learn Python exceptions: try-except-else-finally, raising errors, custom exception classes, and safe patterns for files, I/O, and retries—with examples.
-
Python Comprehensions and Generator Expressions: Scope, Late Binding, Laziness and Memory
How Python comprehensions really behave: clause order, Python 3 scoping and the class-body trap, late-binding lambdas, one-shot generators, walrus, and memory.
-
C++ vs Python: Which Language Should You Learn?
C++ vs Python compared for beginners: speed, difficulty, memory, jobs, and learning curves—with benchmarks, checklists, and when to pick each language.
-
Python Meets C++: High-Performance Engines with pybind11
Bind C++ to Python with pybind11: minimal modules, CMake/setuptools builds, NumPy buffers, GIL release, wheels, and production patterns.
-
Sorting Problems: Multi-Key Sorts, Custom Comparators, and When Sorting First Solves the Problem
Sorting interview problems in Python: stable multi-key sorts, cmp_to_key comparators, why sort-by-end greedy works, and comparator bugs that fail submissions.