def execfile(filename, globals=None, locals=None): with open(filename, "rb") as fp: six.exec_(compile(fp.read(), filename, 'exec'), globals, locals)