import sys def foo(): print("哈哈想不到吧") if __name__ == '__main__': getattr(sys.modules[__name__],"foo")()