Python 2/3 support

Making the python scripts work on both python2 and 3