[PythonCE] Build minimized Python2x.dll for WinCE/PPC?

Stewart Midwinter stewart.midwinter at gmail.com
Thu Feb 10 04:34:58 CET 2005


Welcome Jesse:

well there certainly is a version of Python2.x for Pocket PC.  The
latest built version is 2.3.4; I'm using it myself on a Toshiba e830. 
You can find it here:
http://fore.validus.com/~kashtan/, 

I'm building an app that uses socket communications with a client
talking via WiFi to a server on a network.  the main issue is not the
socket per se, but rather the interaction of threads with my Tkinter
GUI...

Look in the archives on this list and you'll find lots of goodies. 

Couple gotchas: 
1. you can install the whole thing to an external card, but make sure
you edit the Python Install.lnk file to reflect the location before
running it or else double-clicking in Explorer won't work.
2. your source code apps can go anywhere, but you'll need to add a
line to add your python location to the sys.path, and another so
Tkinter can be found. Best way is to create a module in your docs
folder called, say, pythonrc.py, and in it put something like:

import sys
sys.path.append('\\SD Card\\Program Files\\Python\\Lib')
sys.path.append('\\SD Card\\Program Files\\Python\\Lib\\python23.zip\\lib-tk')
sys.path.append('\\SD Card\\')
docHome = ('\\My Documents\\Python')

Also, so that I can run my apps on either PocketPC or Windows desktop
at my leisure, I add the following to them:

if __name__ == '__main__':
   OS = os.name.lower()
   if OS == 'ce':
       import osce
       import pythonrc     #contains the sys.path.append() commands
       import Pmw
       docHome = pythonrc.docHome
   else:
       # we are on the desktop
       global thisDir
       thisDir = sys.path[0]
       docHome = thisDir 
       sys.path.append('c:\\programs')
       import Pmw

Note that there's an osce.py that you can find on this list.  Also, Ed
Blake has put together a mini version of idle called idleCE, which
youcan find at: http://kitsu.petesdomain.com/files/IdleCE.py

there's also a VGA version of the PythonCE.exe, though you may need a
utility like ForceHiRes to get it to actually run in hi-res mode. 
I've found that the Tkinter apps look *much* nicer when run that way.

cheers
S


-- 
Stewart Midwinter
stewart at midwinter.ca
stewart.midwinter at gmail.com


More information about the PythonCE mailing list