replaced execfile, updated octal literal, raise and print syntax

compatibility with python3