def main(path, n): def do_the_import(): from mypkg.sub import mod import sys sys.path.append(path) for i in range(n): do_the_import()
def main(path, n): import sys sys.path.append(path) from mypkg.mod import do_the_import for i in range(n): do_the_import()