摘要:
if __name__ == '__main__'的意思是: 当.py文件被直接运行时,if __name__ == '__main__'之下的代码块将被运行; 当.py文件以模块形式被导入时,if __name__ == '__main__'之下的代码块不被运行。 1 一个.py文件被其他.py文 阅读全文
posted @ 2019-08-28 10:08
菩提花开
阅读(327)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python # -*- coding: UTF-8 -*- def hello_world(): print('Hello world') def three_hello_world(): for i in range(3): hello_world() if __name__ == '__main__': three_hello_world() 阅读全文
posted @ 2019-08-28 09:05
菩提花开
阅读(123)
评论(0)
推荐(0)

浙公网安备 33010602011771号