code: def run_file(path):
      
      if PY26:
          dirpath, name, _ = splitname(path)
          found = imp.find_module(name, [dirpath])
          module = imp.load_module("__main__", *found)
          return vars(module)
      else:
          return runpy.run_path(path, run_name="__main__")
docs: Run a module from a path and return its variables.