python查看源码的时候__all__的作用

__all__ = ["fun1", "fun2"]


def fun1():
    print(111)


def fun2():
    print(2222)


def fun3():
    print(3333)


if __name__ == '__main__':
    pass

test1.py

 

 如果定义了__all__ = [fffffff]   在其他py导入*的时候只导入all列表中的

posted @ 2020-07-22 11:19  Tarzen  阅读(135)  评论(0编辑  收藏  举报