Alter python build scripts to be python3 compatible

Change print, except, and file() to use print, except as, open()
respectively
alter closure copmilation python to be python3 compatible