Saturday, April 25, 2009

Embedding Python in Windows Mobile C++


1. Download and unpack Python sources from

2. On 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 ( from link

4. Unpack the patch and

- copy "PC" folder to original Python sources

- use GNU patch utility ( 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"


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


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



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