Added a python 3.4 compatible version of the script

These are the changes I had to make for the script to run with python 3.4. Do with it as you please.