def get_globals(script): path = posixpath.expanduser(script) if not posixpath.exists(path): path = get_path(script) if not path: raise Exception("Script not found in PATH: %s" % script) globals = {} exec(compile(open(path).read(), path, 'exec'), globals) return globals
def get_globals(script): path = posixpath.expanduser(script) if not posixpath.exists(path): path = get_path(script) if not path: raise Exception, "Script not found in PATH: %s" % script globals = {} execfile(path, globals) return globals