推荐学习书目
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
lunafreya
V2EX  ›  Python

从绝对路径 import Python module

  •  
  •   lunafreya · Aug 14, 2018 · 3211 views
    This topic created in 2855 days ago, the information mentioned may be changed or developed.

    因为平时经常用一些未 pub 到 pypi 的包,而且又深感每次都要改 PYTHONPATH 或者手动管理 sys.path 麻烦,因此弄一个这样的包来从绝对路径 import。

    Github URL:

    aHR0cHM6Ly9naXRodWIuY29tL2xpbnRoaWVkYS9hYnNfaW1wb3J0

    目前只会根据路径拓扑来找到最上级的 package, 虽然没有什么技术含量,但可能比较适合炼丹人士.

    Contribution welcomed.

    7 replies    2018-08-14 13:36:11 +08:00
    xiaket
        1
    xiaket  
       Aug 14, 2018
    感觉这种做法带来的问题比解决的问题多...
    jingniao
        2
    jingniao  
       Aug 14, 2018 via Android
    这种,如果在生产环境使用……
    947211232
        3
    947211232  
       Aug 14, 2018
    换个环境就 GG
    nooper
        4
    nooper  
       Aug 14, 2018
    写个 url 还 hack 一下。累
    pabupa
        5
    pabupa  
       Aug 14, 2018
    炼丹人士是啥意思呀?
    yangtukun1412
        6
    yangtukun1412  
       Aug 14, 2018
    GjriFeu
        7
    GjriFeu  
       Aug 14, 2018
    @pabupa
    可能是身份尊贵的意思,炼丹的人在普通人中的地位都比较高
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5433 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 08:03 · PVG 16:03 · LAX 01:03 · JFK 04:03
    ♥ Do have faith in what you're doing.