def printtest( par ):
print( "Hello : ", par)
return
新建一个def,演示调用
#!/usr/bin/python
# # -*- coding: UTF-8 -*-
import support
support.printtest("hazy")
# from test201022 import printlist
#
# printlist(name = "cc",age = 27)
from test201022 import *
printlist(name = "hazy",age = 26)
import math
content = dir(math)
print(content)
Python的from语句让你从模块中导入一个指定的部分到当前命名空间中。
dir()函数一个排好序的字符串列表,内容是一个模块里定义过的名字。