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? Thanks for your time, Terry Terry Ware Sr. Software Engineer BAE Systems Advanced Information Technologies Suite 500 3811 North Fairfax Drive Arlington Va. 22203 office: (703)284-8425 fax: (703)524-6280 terry.ware@baesystems.com
Terry Ware <terry.ware@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
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@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@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Anthony Tuininga anthony@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
The py2exe tool might be what you're looking for. I've been using it for a while now to simplify the distribution of a project with embedded python modules and it's working out pretty well. The associated wiki page contains some information on how to use py2exe to assist in the deployment of embedded projects. py2exe: http://starship.python.net/crew/theller/py2exe/ wiki: http://starship.python.net/crew/theller/moin.cgi/Py2Exe Tom On Thursday 02 December 2004 8:29 am, Terry Ware wrote:
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?
Thanks for your time,
Terry
Terry Ware Sr. Software Engineer BAE Systems Advanced Information Technologies Suite 500 3811 North Fairfax Drive Arlington Va. 22203 office: (703)284-8425 fax: (703)524-6280 terry.ware@baesystems.com
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
participants (4)
-
Anthony Tuininga
-
Terry Ware
-
Thomas Heller
-
Tom Cocagne