Saturday, April 25, 2009

Embedding Python in Windows Mobile C++

Build


1. Download and unpack Python sources PythonCE-2.5-20061219-source.zip from www.sourceforge.net

2. On www.sourceforge.net in Tracker>Patches section click on "PythonCE 2.5 for WM Smartphone" are information about the patch for WM5/WM6 OS version, which can be build with Vs2005

3. Download the patch file (Python-2.5-20071004-patch.zip) from link http://sourceforge.net/project/showfiles.php?group_id=104228&package_id=247631

4. Unpack the patch and

- copy "PC" folder to original Python sources

- use GNU patch utility (http://gnuwin32.sourceforge.net/packages/patch.htm) to both .patch files

- patch -p1 << smartphone.patch

- patch -p1 << vs2005-compiler.patch

5. Go to directory ...\PCbuild\WinCE\ and start the build command "scons.bat"

6. For debug builds use "scons.bat debug-all"


Use


1. Copy python25.dll to the mobile

2. Link against the python25.lib

or for debug

1. Copy python25_d.dll to the mobile

2. Link against the python25_d.lib


Problem


The only problem is the DLL size, which is over 2.5 megabytes, I have asked here what I can do with it:

https://sourceforge.net/forum/forum.php?thread_id=3241586&forum_id=358833


Links


http://sourceforge.net/projects/pythonce/

2 comments:

  1. its really good stuff. Its really good Windows Mobile C++ development. its really helpful for our Mobile Application Developer.

    ReplyDelete