Ninad

Ninad

A Python and PHP developer turned writer out of passion. Over the last 6+ years, he has written for brands including DigitalOcean, DreamHost, Hostinger, and many others. When not working, you'll find him tinkering with open-source projects, vibe coding, or on a mountain trail, completely disconnected from tech.
Creating Python Modules

Creating Python Modules

When one Python file needs to use a function defined in another, you can put that function in a module. A Python module is a source file that another file can import. In this piece, I’ll show how to save…

Environment Variables in Python: A Complete Guide

Environment Variables in Python: A Complete Guide

When a Python program needs settings that vary between machines, keeping those values out of its source code lets you change configuration separately. Environment variables are named text values supplied to a running process, and Python reads them through os.environ.…

Python sorted() to Sort Lists

Python sorted() to Sort Lists

Ordering a list of scores or names in Python doesn’t require writing your own sorting routine. The built-in sorted() returns a new list of the items in order and leaves the original unchanged. I’ll walk you through sorting in either…

SciPy Minimize: Fit a Function and Check the Result

SciPy Minimize: Fit a Function and Check the Result

Fitting a line to data points means finding the slope and intercept that make the line’s errors as small as possible. SciPy’s minimize function searches for those values, starting from a guess you give it. The example writes the error…