Prahlad Yeri

Freelance Programmer and Writer

Articles in the Python category

dateutil.relativedelta: A must have tool in your python kitty

Making additions or subtractions to datetime variables is one of the most commonly encountered programming endeavors and that's what the built-in datetime.datetime.timedelta object is for in python. Its very useful in adding hours or days to your datetime variables as follows: import datetime now = tea_time … Read More

The Right Way to serve static files when using Django with Gunicorn

Yesterday, I learned during deployment that your Django app when used in combination with gunicorn will refuse to serve static files, do whatever you may. I looked up almost every Stack Overflow answer post on this topic including this, this and this. I meddled with almost every hopeful setting including … Read More

A crash course in Python Packaging

This guide isn't for the newbie who is just learning python programming (they are better off doing a "proper" reading of the official docs instead). This is for the seasoned coder who dabbles in multiple technologies and needs a quick refresher on how to go about building a neat zip … Read More

Why you should never use the dict.get() method in Python

There is an increasing trend towards using the dict.get() method in Python, its very widely used in many tutorials and examples too. Condsider the below example for instance: >>> dd = {'a': 1} >>> dd.get('a') 1 This simple dictionary dd has only one key ('a') and its corresponding value is … Read More

Python Recipe: Combine Multiple Images Into One PDF

Many a times, you come across the need to combine multiple image files (.jpg, .png, etc.) into one single portable document format (.pdf). Maybe, you have a bunch of handwritten notes which you want to organize into one file. Doing that is very trivial if you know python. To being … Read More

Page 1 / 2 »