port to python3 so it can work on Sublime Text 3