在__all__里面写了谁,到时候就只能用谁,其他的用不了,from 模块 import *时就只能用__all__里的

__all__=['test1','Test']

def test1():
    print('test1')

def test2():
    print('test2')

num=100

class Test(object):
    pass

 

相关文章: