import 與from...import
在python用import或者from...import來導入相應的模塊。
將整個模塊(somemodule)導入,格式為:import somemodule
從某個模塊中導入某個函數,格式為:from somemodule import somefunction
從某個模塊中導入多個函數,格式為:from somemodule import firstfunc, secondfunc, thirdfunc
將某個模塊中的全部函數導入,格式為:from somemodule import *
"""
import sys
print('================Python import mode==========================');
print ('命令行參數為:')
for i in sys.argv:
print (i)
print ('\n python 路徑為',sys.path)
# 匯入日曆
import calendar
#輸入指定年月
yy = int(input("輸入年份: "))
mm = int(input("輸入月份: "))
# 顯示日曆
print(calendar.month(yy,mm))