Python3 port

I'm using the code for a python3 project, so I thought I'd push the code I'm using. It's not python2 compatible!