zxx_03_hanshu.py
#下方是个函数
def multiple_table():
row=1
while(row<=9):
x=1
col = 1
while(col<=row):
print("%d*%d=%d" % (x, row, x * row), end="\t")
col+=1
x+=1
print("")
row+=1
print("你好")
multiple_table()
print("你dssf好")
num=10
zxx_03_test.py
import zxx_03_hanshu
这时的代码执行结果表明了在import一个模块时会先执行一次模块中的代码
zxx_03_test.py
import zxx_03_hanshu
print(zxx_03_hanshu.num)
调用模块变量