Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我第一次使用 Paver,我无法在我的 pavement.py 中导入我在同一目录中创建的模块。在同一目录中的独立脚本中导入该模块时,该模块正在工作。我猜摊铺机是从其他地方运行的,而不是同一个目录。
有什么建议吗?
经过一番调查,我找到了解决方案......
import sys sys.path.append( os.path.abspath('.') ) import mymodule.myscript as myscript