Ray's playground

 

Extend python with C

hellomodule.c

Build the extension using Microsoft Visual Studio
cl /LD hellomodule.c /Ic:\Python26\include c:\Python26\libs\python26.lib /link/out:hello.dll

setup

python setup.py build

Usage:
1 import hello
2 hello.say_hello("World")
3 

output: Hello World!

posted on 2009-09-21 13:43  Ray Z  阅读(452)  评论(1编辑  收藏  举报

导航