embedded python in c++ packaging

Furkan Kuru furkankuru at gmail.com
Thu Feb 7 18:05:46 EST 2008


I do not have access to my development machine right now.
but is it enough adding just a simple line at the top of my main python file
'sys.path.append("modules.zip")' before importing any other modules?

On 2/7/08, Gabriel Genellina <gagsl-py2 at yahoo.com.ar> wrote:
>
> En Thu, 07 Feb 2008 16:18:57 -0200, Joshua Kugler <jkugler at bigfoot.com>
> escribió:
> > Furkan Kuru wrote:
> >>
> >> I have been developing an application in C++ that embeds Python
> >> interpreter. It takes advantage of too many modules from Python.
> >> When I want to package this application, I need to add too many files
> >> (.pyc) from Python/lib folder together with Python25.dll.
> >> Is there a way to pack these .pyc files to a zip file and redirect
> >> Python25.dll to that zip file?
> >
> > That is effectively what py2exe does with the modules required by the
> > main
> > application.  It takes all the required modules and puts them in a
> > library.zip file.  You might take a look at how it does it.
>
> Using py2exe has an additional advantage, it recursively scans all modules
> looking for dependencies.
> Once you know the required set of modules, you can bundle them in a .zip
> file and add its full path into sys.path (the absolute path including
> filename and .zip extension). Python does look into the .zip searching for
> modules.
>
> --
> Gabriel Genellina
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Furkan Kuru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080208/e19a38f9/attachment.html>


More information about the Python-list mailing list