def execfile(file_path, globals=None, locals=None):
if globals is None:
globals = {}
globals.update({
"__file__": file_path,
"__name__": "__main__",
})
with open(file_path, 'rb') as file:
exec(compile(file.read(), file_path, 'exec'), globals, locals)