Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Compiling Python on Windows : how to deal with modules ? (http://www.velocityreviews.com/forums/t683512-compiling-python-on-windows-how-to-deal-with-modules.html)

r2d3 05-11-2009 08:49 AM

Compiling Python on Windows : how to deal with modules ?
 
Hi Pythoners,

I am using Python embedded in my application (OSX,Windows) and I need
to distribute Python as part of my application.

On OSX, no problem, I got a self contained framework (with dynamic
library and all the modules).

On Windows, I manage to compile Python 2.6.2 with PCbuild\build.bat
and I get python26.dll/python26_d.dll.

But the readme gives no clue about how to deal with the module
"compilation"/installation.

So how do I "compile"/package all the modules that comes with Python
source distribution on Windows ? To embed it in my distribution, I
just copy the whole Modules tree (only pyc/pyo/pyd files ?) ? and set
the right sys.path from my C code (using PySys_SetPath) ?

Thanks in advance.

r2d3 05-12-2009 11:53 AM

Re: Compiling Python on Windows : how to deal with modules ?
 
Hi all,

after some investigation, I managed to find how to do this "manually".
I post it here if it could help others...

1) on windows, mostly all the dynamic libraries (time, socket, ...)
are statically linked into python26.dll
2) all the modules are located in lib/ and some .pyd (in fact renamed
dll files) live in PCbuild
3) "PCBuild\python -m compileall lib" will compile all the .py under
lib which then could by zipped into a single python26.zip

So I will just need to distribute python26.dll and python26.zip with
my app and set sys.path (using PySys_SetPath) to point to python26.zip
+ the place where I store the .pyd.

I will solve the "user want to add other module" later using
PYTHONPATH or allowing the user to add python path through our GUI.

Best regards.

On 11 mai, 10:49, r2d3 <david.geldre...@free.fr> wrote:
> I am using Python embedded in my application (OSX,Windows) and I need
> to distribute Python as part of my application.
>
> On OSX, no problem, I got a self contained framework (with dynamic
> library and all the modules).
>
> On Windows, I manage to compile Python 2.6.2 with PCbuild\build.bat
> and I get python26.dll/python26_d.dll.
>
> But the readme gives no clue about how to deal with the module
> "compilation"/installation.
>
> So how do I "compile"/package all the modules that comes with Python
> source distribution on Windows ? To embed it in my distribution, I
> just copy the whole Modules tree (only pyc/pyo/pyd files ?) ? and set
> the right sys.path from my C code (using PySys_SetPath) ?



All times are GMT. The time now is 09:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.