[#9] Fix output.py to work with python2