V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
larkifly
V2EX  ›  Python

from sh import ls,看源码时,没有看到关于 ls 相关函数或者类的实现,但是却不会报错,请问这是怎么实现的?

  •  
  •   larkifly · 2015-01-27 10:53:22 +08:00 · 2068 次点击
    这是一个创建于 3370 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题,很好奇

    搞定了,动态导入
    1 条回复    2015-01-27 11:01:40 +08:00
    virusdefender
        1
    virusdefender  
       2015-01-27 11:01:40 +08:00
    肯定有的 你看看 sh里面是不是有 from ... import *之类的,估计隐藏在*里面了~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5230 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:45 · PVG 13:45 · LAX 22:45 · JFK 01:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.