Blog / Python

How to continuously monitor your Wi-Fi’s signal strength in Ubuntu

October 1, 2013

I was staying at an apartment last night that didn’t have its own Wi-Fi so I had to borrow from a neighbor. However, the signal was very weak and I had to find just the right spot in my apartment to get a decent connection.

Ubuntu has a utility called iwconfig that lets you view your wireless connection’s signal strength. Typing in‘iwconfig wlan0’ (where ‘wlan0’ is the interface name) in a shell would return …

Some tips with integrating Stripe with a subscription-based Django application

August 12, 2013

I just finished integrating Stripe with a subscription-based Django application a few weeks ago for processing credit card payments. This was the first time I've used this service and found the Stripe API and documentation to be very well written. Below are some things I learned while working on this project.

Avoid storing any credit card data in your database if you can for Payment Card Industry (PCI) compliance

One of the main reasons to …

A simple Python program for exporting a list of dictionaries to a PDF table using ReportLab

April 16, 2013

I’m currently working on a project where I need to generate some reports in PDF format. Pretty much all of them use tables to display some data from a database, so I created this small program for easily exporting a list of dictionaries to a table in a PDF file.

data_to_pdf.py

from operator import itemgetter

from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.units import inch
from reportlab.lib.pagesizes import letter
from reportlab.platypus import Paragraph, …

Getting started with virtualenv on Ubuntu 12.04

April 1, 2013

virtualenv is one of those tools that every Python developer should use. It lets you create isolated Python environments for your projects so you can try out different versions of packages/libraries the applications use on the same machine.

You could do something similar using virtualization software such as VMware or VirtualBox, but they take up more resources and take longer to set up. With virtualenv, you can set up these isolated environments in seconds! …

Simple Python program to help improve your Spanish vocabulary

February 4, 2012

I’ve been taking 4 hours of Spanish lessons in Antigua, Guatemala for the last 4 days now. I’ve learned a lot in this last 4 days but I still have a ton to learn. My Spanish vocabulary needs a lot of work, so I wrote this simple Python program to help me.

The program loads a list of words from a CSV file (I export my CSV files from Google Docs), shuffles them, iterates …