Modified the python scripts so that they can run on python2 and python3