Skip to main content

113 posts tagged with "uv"

uv, the Fast Python Package and Project Manager, Its Commands and pyproject.toml

View All Tags

How to Set Up Logging in Python with logging.basicConfig

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

print is fine for quick checks, but a real program needs messages with a level, such as information, warnings and errors, so you can choose which ones to show. Python's logging module does that, and logging.basicConfig sets it up in one line. This guide turns logging on for a small script, with real output from Python 3.15.2.

How to Catch a Specific Exception in Python

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

When something goes wrong, Python raises an exception, and the script stops unless something catches it. Catching one specific kind, such as ValueError, lets you handle the problem you expected while every other error still stops the script and shows you where it happened.