美文网首页
【python】sys.path.append

【python】sys.path.append

作者: blue_smile | 来源:发表于2016-11-29 09:56 被阅读0次

对于模块和自己写的程序不在同一个目录下,可以把模块的路径通过sys.path.append(路径)添加到程序中。

在程序开头加上:

import sys
sys.path.append(’引用模块的地址')

相关文章

网友评论

      本文标题:【python】sys.path.append

      本文链接:https://www.haomeiwen.com/subject/yqeapttx.html