1、模塊,命名為sunck.py為例子
#一個.py文件就是一個模塊
def sayGood():
print("sunck is a very good man!")
def sayNice():
print("sunck is a nice man!")
def sayHandsome():
print("sunck is a handsome man!")
TT = 100
2、調用例子
#from……import語句
#作用:從模塊中導入一個指定的部分到當前命名空間
#格式:from module import name1[, name2[, ……namen]]
from sunck import sayGood, sayNice
'''
程序內容的函數可以將模塊中的同名函數覆蓋
def sayGood():
print("********")
'''
sayGood()
sayNice()
#sayHandsome()#沒有引入handsome函數