导入自定义包

mypath=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#os.path.dirname  获取文件的目录名
#os.path.abspath  获取文件的当前路径
#__file__   当前文件
sys.path.insert(0,mypath)
#文件的系统路径

猜你喜欢

转载自www.cnblogs.com/randomlee/p/9251840.html