Articles filed under Python


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 = datetime.datetime.now() tea_time … 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, it's very widely used in many tutorials and examples too. Consider 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 »