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

Python 使用 c 语言写的这些 lib 的 py binding 的最佳实践是什么,好像没办法在 venv 的环境里直接用

  •  
  •   edis0n0 · Nov 2, 2022 · 2645 views
    This topic created in 1303 days ago, the information mentioned may be changed or developed.
    5 replies    2022-11-03 16:26:51 +08:00
    YsHaNg
        1
    YsHaNg  
       Nov 2, 2022 via iPhone
    ctypes ?
    cclin
        2
    cclin  
       Nov 2, 2022 via Android
    编译好的吗?放在 pythonpath 目录下就行
    需要注意 python 版本要一致
    Huelse
        3
    Huelse  
       Nov 2, 2022
    pybind11 编译动态库后直接在当前目录可以用的
    clemente0620
        4
    clemente0620  
       Nov 2, 2022
    pybind11
    julyclyde
        5
    julyclyde  
       Nov 3, 2022
    ctypes 或者 cffi 吧
    运行时加载比较方便

    比编译一个 binding 要好一些。因为 binding 库编译的时候会 link 到具体的 python 版本,换 python 的时候还得再编译一次
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1028 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 22:34 · PVG 06:34 · LAX 15:34 · JFK 18:34
    ♥ Do have faith in what you're doing.