模块和包 1
# import os # os.makedirs('glance/api') # os.makedirs('glance/cmd') # os.makedirs('glance/db') # l = [] # l.append(open('glance/__init__.py','w')) # l.append(open('glance/api/__init__.py','w')) # l.append(open('glance/api/policy.py','w')) # l.append(open('glance/api/versions.py','w')) # l.append(open('glance/cmd/__init__.py','w')) # l.append(open('glance/cmd/manage.py','w')) # l.append(open('glance/db/__init__.py','w')) # l.append(open('glance/db/models.py','w')) # map(lambda f:f.close() ,l) # import glance # # glance.api.policy.shui() # # # 看着没问题 # # print(dir(glance)) # # glance.api.policy.shui() # # # import sys # # # 启动文件所在的位置,决定了sys.path的路径 # # print(sys.path) # 查看模块的搜索路径 # from glance import * # from glance import chi, bingbing,he # # chi() # print(bingbing) # he() # 点前面的一定是包 import glance.api.policy glance.api.policy.shui() from urllib.request import urlopen