#abc.py调用mymodulecalc.py
#abc.py
#调用模块
#import mymodulecalc
#print(mymodulecalc.mymin(1,2),mymodulecalc.mymax(1,2))
from mymodulecalc import mymin,mymax
print(mymin(1,2),mymax(1,2))
'''
'E:\\Users\\xutie\\AppData\\Local\\JetBrains\\PyCharm Community
Edition 2019.3.1\\plugins\\python-ce\\helpers\\third_party\\thriftpy',
'E:\\Users\\xutie\\AppData\\Local\\JetBrains\\PyCharm Community Edition 2019.3.1\\plugins\\python-ce\\helpers\\pydev',
'E:\\Users\\xutie\\AppData\\Local\\Programs\\Python\\Python38-32\\python38.zip',
'E:\\Users\\xutie\\AppData\\Local\\Programs\\Python\\Python38-32\\DLLs',
'E:\\Users\\xutie\\AppData\\Local\\Programs\\Python\\Python38-32\\lib',
'E:\\Users\\xutie\\AppData\\Local\\Programs\\Python\\Python38-32',
'E:\\Users\\xutie\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages',
'C:/Users/xutie/AppData/Local/Temp/python3.py']
'''
#可以将模块放到sys.path包含的任何一个目录中
import sys
paths=sys.path
for p in paths:
print(p)
#mymodulecalc.py
def mymin(a,b):
c=a
if a>b:
c=b
return c
def mymax(a,b):
c=a
if a<b:
c=b
return c