Python—导入自定义的模块和包(指定路径下的模块和包)


模块路径如下图:

import sys

sys.path.append(r"E:\project\path")
print "===>", sys.argv[0]
from testone import work print work.run() from testone.work import run print run()
from testone.testsix import hello print hello.eat() from testone.testsix.hello import eat print eat()

 

https://www.cnblogs.com/telazy/p/8967515.html
https://blog.csdn.net/weixin_41824719/article/details/81051743


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM