开发者

How to import modules in Paver?

开发者 https://www.devze.com 2023-01-30 09:19 出处:网络
I am using Paver for the firs开发者_开发知识库t time and I can\'t import in my pavement.py a module I created in the same directory. The module was working when imported in a standalone script in the

I am using Paver for the firs开发者_开发知识库t time and I can't import in my pavement.py a module I created in the same directory. The module was working when imported in a standalone script in the same directory. I guess paver is running from somewhere else, not the same directory.

Any suggestion?


After a bit of investigation I found a solution...

import sys
sys.path.append( os.path.abspath('.') )
import mymodule.myscript as myscript
0

精彩评论

暂无评论...
验证码 换一张
取 消