vc6编写python扩展的方法分享
2014-01-17 00:00
633 查看
系统环境:VC6 + Python-2.5.4
1、下载Python-2.5.4源码。
2、解压,打开D:\Python-2.5.4\PC\VC6\pcbuild.dsw,编译,D:\Python-2.5.4\PC\VC6\下得到python25.dll、python25_d.dll、python25.lib、python25_d.lib。
3、使用VC6建立一个动态链接库工程,拷贝D:\Python-2.5.4\PC\example_nt\example.c到工程目录下,并添加到工程中。
4、设置工程。
5、编译。
6、尝试调用:
1、下载Python-2.5.4源码。
2、解压,打开D:\Python-2.5.4\PC\VC6\pcbuild.dsw,编译,D:\Python-2.5.4\PC\VC6\下得到python25.dll、python25_d.dll、python25.lib、python25_d.lib。
3、使用VC6建立一个动态链接库工程,拷贝D:\Python-2.5.4\PC\example_nt\example.c到工程目录下,并添加到工程中。
4、设置工程。
打开tools->options->directories,添加D:\PYTHON-2.5.4\INCLUDE 到 includes files中,添加D:\PYTHON-2.5.4\PC\VC6 到 Library files中。 打开Progect->Settings,将Win32 Debug->Link->Output file name修改为example_d.pyd,将Win32 Release->Link->Output file name修改为example.pyd
5、编译。
6、尝试调用:
D:\MY Project\testpymodule\Release>python Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import example >>> example.foo() Hello, world >>>
相关文章推荐
- vc6编写python扩展的方法分享
- Python调用C函数的方法以及如何编写Python的C扩展
- Python 内编写类的各种技巧和方法
- VC编写DLL几种方法的简介
- robot framework用python扩展编写自定义library
- 如何用boost.python编写python扩展
- 在Windows中使用VC++2010扩展python
- 实例探究Python以并发方式编写高性能端口扫描器的方法
- python字符串加密解密的三种方法分享(base64 win32com)
- 利用C++ Boost编写扩展Python模块
- VC编写DLL几种方法的简介
- 使用IDLE编写Python程序出现汉字横着显示的解决方法(附删除键空格消除)
- Python扩展方法及工具比较
- 分享一下Python 开发者节省时间的10个方法
- 分享: Python调用C/C++的种种方法
- VC编写DLL几种方法的简介
- Windows系统配置python脚本开机启动的3种方法分享
- 编写Python爬虫抓取豆瓣电影TOP100及用户头像的方法
- Python扩展包安装方法以及Python添加库(模块)
- python扩展实现方法--python与c混和编程