How to Install FastAPI and Create Your First API

Install FastAPI and create your first API: Swagger UI listing the Store Hours API endpoints

Picture a small retail chain that wants its website and phone app to read store hours from one place. A tiny API solves that, and you can have one running in about ten minutes. In this tutorial, we’ll install FastAPI inside a virtual environment using pip install “fastapi[standard]”, then build that store-hours API. I ran … Read more >>

How to Create an App Using Python (CLI, Desktop and Web)

How to create an app using Python: a PyQt6 desktop tip calculator window

Here’s how to create an app using Python: decide what kind of app it is (command line, desktop or web), pick the matching library, and build a small working version first. For a desktop window, PyQt6 takes about 30 lines: To keep things comparable, I built the same tip calculator three ways and ran each … Read more >>

SciPy Stats zscore: Calculate Z-Scores in Python

SciPy stats zscore: bar chart of daily sales z-scores with the Black Friday outlier above the +3 line

A Denver retail client asked me to flag days where online sales looked unusual, and SciPy stats zscore handled it in one line. The catch: SciPy and pandas don’t agree on the standard deviation, so one day can get two scores. Quick answer: call scipy.stats.zscore(data). It returns (x – mean) / std per value, with … Read more >>

EDSR Super-Resolution in Keras: Build and Train It on a CPU

EDSR super-resolution in Keras: bicubic vs EDSR x2 upscaling of the scikit-image cat photo with PSNR

A real estate agent in Tampa sent me listing photos her old website had shrunk to half size. Could Python bring the detail back? EDSR super-resolution in Keras can. Enhanced Deep Residual Networks (EDSR) upscale images with stacked residual blocks; my tiny version trained 148 seconds on a CPU and beat bicubic resizing on two … Read more >>

Machine Learning for Document Classification in Python

Machine learning for document classification: classification report and confusion matrix in Command Prompt

Your shared drive has thousands of files, and someone has to decide which ones are invoices, contracts or support tickets. Quick answer: machine learning for document classification turns each document into numbers (TF-IDF word weights) and trains a classifier on labeled examples, so it can sort new files on its own. In scikit-learn, that’s a … Read more >>

How to Install Python on a Chromebook (Step by Step)

How to install Python on Chromebook: Google's help page for turning on the Linux development environment

Here’s how to install Python on a Chromebook: turn on the Linux development environment in Settings, open the Terminal app, and Python 3 is already there. Add pip and venv with one command: I don’t have a Chromebook on my desk, so the steps follow Google’s current help page, captured in October 2026, and the … Read more >>

Guess the Number Game in Python (With Full Code)

Guess the number game in Python: a console game with too high and too low hints

A guess the number game in Python needs three things: a secret from random.randint(1, 100), a loop that reads guesses with input(), and “too high” or “too low” hints until the player gets it: I played each version below in Command Prompt on Python 3.12.5, typing the guesses myself, including some bad input. You’ll build … Read more >>

How to Clear the Screen in Python (Windows, Mac, Linux)

How to clear the screen in Python: Command Prompt after os.system cls cleared earlier output

Here’s how to clear the screen in Python: call the terminal’s own clear command with os.system(), using cls on Windows and clear on macOS and Linux. One line handles both: The screenshots show Command Prompt windows on Windows 11 with Python 3.12.5, captured after the clear ran, so you only see what survived it. I’ll … Read more >>

Pong Game Code in Python (Turtle, Full Program)

Pong game code in Python: the turtle window showing paddles, the ball and the final score

You can write Pong game code in Python with just the built-in turtle module: two stretched squares for paddles, a circle for the ball, keyboard bindings, and a loop that moves the ball and checks for bounces. No installs needed: I ran the full game below on Python 3.12.5 on Windows; the screenshot is the … Read more >>

Image Super-Resolution in Keras with ESPCN (Sub-Pixel CNN)

Image super-resolution in Keras: bicubic vs ESPCN x3 upscaling of the scikit-image cat photo with PSNR

A reader running a small photo archive asked whether a tiny Keras model could beat plain resizing when you enlarge low-resolution scans. It can. Image super-resolution with ESPCN (an efficient sub-pixel CNN) learns to upscale a picture 3x, and after about 129 seconds of CPU training it beat bicubic resizing on two photos it never … Read more >>