python模块 __name=='__main__' 用法

python模块 __name=='__main__' 用法
1.ceshi_mod1.py
def test1():
print('111111')
def test2():
print('2222')
if __name__ =='__main__':
test1()
2.ceshi_mod2.py
import ceshi_mod1 as tc
tc.test1()

输入一个
111111
posted @ 2017-12-08 08:49  学无边涯  阅读(239)  评论(0编辑  收藏  举报