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

py 与 C Py 与 C++的混写

  •  
  •   saxon ·
    saxon17 · Jul 20, 2015 · 4334 views
    This topic created in 4134 days ago, the information mentioned may be changed or developed.

    Py如何调用C 和C++的函数、类
    问题也可以反过来
    求指教

    11 replies  •  2015-09-14 13:11:52 +08:00
    wynemo
    wynemo
    Jul 20, 2015
    1
    boost python
    wynemo
    wynemo
    Jul 20, 2015
    2
    paw
    paw
    Jul 20, 2015
    3
    ctypes.CDLL 加载C/C++编写的动态链接库
    反过来 不知道。。。没用过
    nooper
    nooper
    Jul 20, 2015
    4
    我写过。可以用cython,swig,boost python。如果简单的就用 简单的方式。
    clino
    clino
    Jul 20, 2015
    5
    @nooper cython是不是这三个里最简单的?
    nooper
    nooper
    Jul 20, 2015
    6
    @clino 不一定看需求。关键是难度和对C++和理解。
    mozartgho
    mozartgho
    Jul 20, 2015
    7
    C/C++中调用Python,就是把Python虚拟机集成到程序中,然后把Python的C API封装下给C++程序调用;Python使用C/C++程序写的扩展,需要把C程序编译成动态库,然后在Python中直接import扩展模块,当然C/C++写扩展需要一定的要求,具体看Python文档。
    janxin
    janxin
    Jul 20, 2015
    9
    相对来说C/C++里用Python会更容易一点,C++的DLL和C的DLL对Python区别挺大
    saxon
    saxon
    OP
    Jul 21, 2015
    10
    @wynemo
    @nooper
    @xanpeng
    @mozartgho
    @janxin 就不一 一感谢了~~ 谢谢热心的回答
    saxon
    saxon
    OP
    Sep 14, 2015 via iPhone
    11
    @xanpeng 谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2019 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 01:25 · PVG 09:25 · LAX 17:25 · JFK 20:25
    ♥ Do have faith in what you're doing.