推荐学习书目
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 · 3993 views
    This topic created in 3979 days ago, the information mentioned may be changed or developed.

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

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