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
szyp
V2EX  ›  Python

谁能帮我找个 Python 库,印象中经常用到的,描述在正文

  •  
  •   szyp ·
    runningzyp · 2023-02-07 16:15:08 +08:00 · 2011 次点击
    这是一个创建于 415 天前的主题,其中的信息可能已经有所发展或是发生改变。
    
    一个经常用到的库,类似 urllib.parse ,也可能就是 urllib.parse
    
    ---------------------------
    
    some method `baz` in foo.bar
    
    
    # do:
        import foo.bar
        
        foo.bar.baz()  ok!
    
    # do:
        from foo.bar import baz  # baz not found
    
    ---------------------------
    
    which module or which method?
    
    

    大概意思就是某个模块必须用 . 连在一起 import ,否则不能用

    如果 python 做不到这种东西,也麻烦说下,也可能是我记错了

    6 条回复    2023-02-08 15:52:43 +08:00
    jstony
        1
    jstony  
       2023-02-07 20:28:05 +08:00
    完全没看明白,能再详细解释解释么?
    Juszoe
        2
    Juszoe  
       2023-02-07 22:42:06 +08:00   ❤️ 1
    符合条件的很多,__init__.py 空着就会导致这种情况
    asmoker
        3
    asmoker  
       2023-02-08 08:59:18 +08:00 via Android
    dateutil ?
    lasuar
        4
    lasuar  
       2023-02-08 10:22:24 +08:00
    @Juszoe 但是我发现__init.py 空着 会导致第一种方式也不行。python3.9
    julyclyde
        5
    julyclyde  
       2023-02-08 10:39:55 +08:00
    os.path 吧
    lookStupiToForce
        6
    lookStupiToForce  
       2023-02-08 15:52:43 +08:00
    看了评论
    我发现有些人可能连 working directory 都玩不明白( sys.path, PYTHONPATH 等变量)......
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1301 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:48 · PVG 01:48 · LAX 10:48 · JFK 13:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.