V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
0.08D
V2EX  ›  Python

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

  •  
  •   szyp · Feb 7, 2023 · 2764 views
    This topic created in 1187 days ago, the information mentioned may be changed or developed.
    
    一个经常用到的库,类似 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 replies    2023-02-08 15:52:43 +08:00
    minibear2021
        1
    minibear2021  
       Feb 7, 2023
    完全没看明白,能再详细解释解释么?
    Juszoe
        2
    Juszoe  
       Feb 7, 2023   ❤️ 1
    符合条件的很多,__init__.py 空着就会导致这种情况
    asmoker
        3
    asmoker  
       Feb 8, 2023 via Android
    dateutil ?
    freemoon
        4
    freemoon  
       Feb 8, 2023
    @Juszoe 但是我发现__init.py 空着 会导致第一种方式也不行。python3.9
    julyclyde
        5
    julyclyde  
       Feb 8, 2023
    os.path 吧
    lookStupiToForce
        6
    lookStupiToForce  
       Feb 8, 2023
    看了评论
    我发现有些人可能连 working directory 都玩不明白( sys.path, PYTHONPATH 等变量)......
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2820 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 01:47 · PVG 09:47 · LAX 18:47 · JFK 21:47
    ♥ Do have faith in what you're doing.