2007年09月27日 星期四 16:59
最近在下载一个python包的时候。偶然看了下他的setup.py
发现setup.py里提供了一个将c源代码编译成动态连接库的功能
于是想。能不能用python来替代make编译c工程呢?
于是我写了一个简单的脚本
from distutils.core import setup, Extension
from distutils.debug import DEBUG
import sys
import os
mods = []
mod1 = Extension('bluetooth_bluetooth',
sources = ['hello.c'])
mods = [mod1]
setup(name='hello',
ext_modules=mods)
发现python仅能把c文件编译成动态连接库却不能编译成可执行文件
有人知道如何用python将c工程编译成可执行文件的方法吗?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070927/b71c8d63/attachment.htm
2007年09月27日 星期四 17:08
scons - A replacement for Make
On Thu, Sep 27, 2007 at 04:59:26PM +0800, Kula wrote:
> 最近在下载一个python包的时候。偶然看了下他的setup.py
> 发现setup.py里提供了一个将c源代码编译成动态连接库的功能
> 于是想。能不能用python来替代make编译c工程呢?
> 于是我写了一个简单的脚本
>
> from distutils.core import setup, Extension
> from distutils.debug import DEBUG
> import sys
> import os
> mods = []
> mod1 = Extension('bluetooth_bluetooth',
> sources = ['hello.c'])
> mods = [mod1]
> setup(name='hello',
> ext_modules=mods)
>
> 发现python仅能把c文件编译成动态连接库却不能编译成可执行文件
> 有人知道如何用python将c工程编译成可执行文件的方法吗?
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
一个非文本附件被清除...
发信人: %(who)s
主题: %(subject)s
日期: %(date)s
大小: 189
Url: http://python.cn/pipermail/python-chinese/attachments/20070927/42e65584/attachment.pgp
2007年09月27日 星期四 17:13
我自己的小程序一直使用scons编译 在07-9-27,liupeng <liupeng at 18mail.cn> 写道: > > scons - A replacement for Make > > On Thu, Sep 27, 2007 at 04:59:26PM +0800, Kula wrote: > > 最近在下载一个python包的时候。偶然看了下他的setup.py > > 发现setup.py里提供了一个将c源代码编译成动态连接库的功能 > > 于是想。能不能用python来替代make编译c工程呢? > > 于是我写了一个简单的脚本 > > > > from distutils.core import setup, Extension > > from distutils.debug import DEBUG > > import sys > > import os > > mods = [] > > mod1 = Extension('bluetooth_bluetooth', > > sources = ['hello.c']) > > mods = [mod1] > > setup(name='hello', > > ext_modules=mods) > > > > 发现python仅能把c文件编译成动态连接库却不能编译成可执行文件 > > 有人知道如何用python将c工程编译成可执行文件的方法吗? > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > > iD8DBQFG+3MEKeZs4sOrPzgRAiA8AJ9Ojutj+EvKCABT1VLOFq3pl5NBtACdGlkO > 2KHJX/r8jpUsYVwBZzNaPNc= > =Yoo6 > -----END PGP SIGNATURE----- > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070927/c521792c/attachment.htm
Zeuux © 2025
京ICP备05028076号