推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
302790951
V2EX  ›  Python

怎么动态调用第三方库?

  •  
  •   302790951 · Nov 25, 2014 · 3327 views
    This topic created in 4325 days ago, the information mentioned may be changed or developed.
    from lib.aa.bb import cc

    其中aa bb是动态的,貌似不能用变量存储 还有什么办法动态调用第三方库吗?
    5 replies  •  2014-11-25 21:20:08 +08:00
    302790951
        2
    302790951  
    OP
       Nov 25, 2014
    @11 感谢

    还有一个问题,python二级目录下的类怎么引用?
    用
    from test.lib.test import test
    报错
    ImportError: No module named lib.test
    c
        3
    c  
       Nov 25, 2014
    302790951
        4
    302790951  
    OP
       Nov 25, 2014
    @11 用imp 库解决了 感谢
    302790951
        5
    302790951  
    OP
       Nov 25, 2014
    @c 用imp 库解决了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2951 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 12:31 · PVG 20:31 · LAX 05:31 · JFK 08:31
    ♥ Do have faith in what you're doing.