链接: https://pan.baidu.com/s/1Pb01gfw_6h0bLNS_ZbAujQ 密码: ipmi
import random
x = random.randint(1, 10)
print(x)
import am
z = am.add(19, 11)
print("testam z", z)
## 122 模塊pyc文件# import後,自動生成pyc文件## 123 模塊自測import amc
z = amc.add(19, 11)
print("using testam z", z)
## 124 模塊配置問題import sys
print(sys.path)
#sys.path.append(r'c:python27s')import amc
import addminus as amd
z = amd.add(20, 19)
print(z)
amd.pprint()
amd.xprint()
addminus.py
defadd(x, y):return x + y
defminus(x, y):return x - y
defpprint():
print("who is called me?")
defxprint():
print("who is called me?")
if __name__ == '__main__':
print("testing my module")
z = add(10, 11)
print("in amc test", z)
if __name__ == 'amc':
pass#print("some using amc module")