[Distutils] Embedding C with Python

Anthony Tuininga anthony at computronix.com
Thu Dec 2 19:21:48 CET 2004


Not even in principle. I've done exactly that for some our applications 
and it works very well. cx_Freeze 
(http://starship.python.net/crew/atuining) is what I have been using but 
I wouldn't be surprised if py2exe can handle this as well.

Thomas Heller wrote:
> Terry Ware <terry.ware at baesystems.com> writes:
> 
> 
>>I work on windows platforms and I have a collection of C routines that
>>are distributed via a DLL. These routines have embedded python calls.
>>Currently I have to distribute the python modules separately from the
>>C DLL.  Is there a way using distutils for me to combine the python
>>scripts with the C code in the C DLL so that all I have to distribute
>>is my C DLL along with the pythonxx.dll?
> 
> 
> You could create a zipfile from the modules you need, and append the
> zipfile to your C dll.  Then, add the pathname of your dll to sys.path
> somewhere in your init code, and zipimport should do the trick.  At
> least in principle ;-)
> 
> Thomas
> 
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

-- 
Anthony Tuininga
anthony at computronix.com

Computronix
Distinctive Software. Real People.
Suite 200, 10216 - 124 Street NW
Edmonton, AB, Canada  T5N 4A3
Phone:	(780) 454-3700
Fax:	(780) 454-3838
http://www.computronix.com



More information about the Distutils-SIG mailing list