[PythonCE] Python CE on a Intel XScale industrial device.

Lachezar Dobrev l.dobrev at gmail.com
Mon Aug 4 11:07:22 CEST 2008


  More updates.

  Thanks to Alexandre I was able to start Python with Tkinter, however
I was a bit disappointed by the hardness of the installation
procedure, and the unexpected dependancy on the TCL Toolkit. No
matter.

  I extracted the .CAB file with a Windows utility called MSCEInf.exe.
  I copied the files to the device using a (W)LAN.
  I then copied the celib.dll and the TCL/TK libraries (a very tedious
procedure).

  I was able to successfully create a Tkinter Frame with a label inside.
  I was also able to run the provided Tkinter._test().

  Trying to install the ppygui however was no success at all.
  A few seconds after starting install.py I got:

> Traceback (innermost last):
>   File "\Temp\ppygui-0.7\install.py", line 5, in <module>
>     import ppygui as gui
>   File "\Temp\ppygui-0.7\ppygui\__init__.py", line 1, in <module>
>     from api import *
>   File "\Temp\ppygui-0.7\ppygui\api.py", line 29, in <module>
>     from html import *
>   File "\Temp\ppygui-0.7\ppygui\html.py", line 101, in <module>
>     _InitHTMLControl()
>   File "\Temp\ppygui-0.7\ppygui\html.py", line 99, in _InitHTMLControl
>     cdll.htmlview.InitHTMLControl(GetModuleHandle(0))
>   File "C:\devl\release\PythonCE-2.5-20061219\Python-2.5-wince\Lib\ctypes\__init__.py", line 387, in __getattr__
>   File "C:\devl\release\PythonCE-2.5-20061219\Python-2.5-wince\Lib\ctypes\__init__.py", line 312, in __init__
> <type 'exceptions.WindowsError'>: [Error 87] Windows Error 0x7E

  Which baffled me completely (I am quite new to this stuff).

  However inspired by this minor success I used a set of tools for Linux:
  1. I extracted the CAB file with cabextract.
  2. I used hexer to edit the *.000 file and replace the supported
processor from 0x0A11 at position 20 with 0x0920 (which is the XScale
processors' cpu id).
  3. I used lcab to 'try' and recreate the CAB with the updated files.

  Well...
  At first the installer no longer bugged me with '... can not run on
this device...'. It actually started copying files.
  However for all the .dll and .exe files the installer said: 'File
... was not copied.' (or something similar). It also told me I need to
get the CAB file from the source location again.
  The result was not very good. I canceled the installation half-way
through (too many pop-ups). The 'Program Files\Python25' had a number
of files and directories similar to what I got when I extracted the
cab with the Windows tool. However all the .dll and .exe files had
zero length. Surprisingly a lot of .pyd files were there with a
positive length. I did not get to the registration process, so I have
not checked the .py .pyc and .pyw associations.
  The un-installation also did no go as expected, leaving most files
inside the device.

  However I believe that this shows, that the processor type IS the
issue with the installer.

  Alexandre...
  Who is 'we' who should rebuild the CABs?
  Any pointers on the ppygui installation issue?

2008/7/31 Alexandre Delattre <alexandre.delattre at enst-bretagne.fr>:
> Hi,
>
> In my opinion if you're able to run the python exe it means that is not processor related.
>
> I think the problem comes from what you've pointed out, the OS versions constraints.
>
> I think we should rebuild the .cab to allow os versions from 4.00 and 5.99 as you suggested. There's also a bug in the cab that would be worth fixing at the same time:
>
> In one of the registry key that associates  .pyw to pythonce without shell we have to replace \nopcceshell by /nopcceshell.
>
> Else this cause the error <NULL>:<NULL> to be raised when running .pyw.
>
> For tKinter, the dll are not shipped with PythonCE and you have to copy them manually, more info on the wiki.
>
> For ppygui I'll be very glad if you use my toolkit, and if you send me your traceback I'll make my possible to make it work for you.
> I think the issue you described comes from that ppygui was designed for PocketPC 2003 and Windows Mobile, while it seems from screenshot your device has the 'classic' wince interface.
>
> Regards,
> Alexandre
>
>
> ----- Message d'origine -----
> De: Lachezar Dobrev <l.dobrev at gmail.com>
> Env: jeudi 31 juillet 2008 17:05
> À: Alexandre Delattre <alexandre.delattre at enst-bretagne.fr>
> Objet: Re: [PythonCE] Python CE on a Intel XScale industrial device.
>
>  Update follows...
>
>  People on this list were quite helpful in referencing a couple of
> tools for Pocket PC CAB file mangling.
>  1. I was able to extract the Python CE CAB file an uploaded the
> extracted files to my device. The python executable had an icon, and I
> was able to run it. It seemed to work. I was able to execute a few
> minor tests my way: a few dir()-s, a few imports, a few Base64
> encoding and decoding operations, and it seemed to work fine. Until I
> tried to import Tkinter:
>
>> >>> import sys
>> >>> import Tkinter
>> Traceback (most recent call last):
>>   File "C:\devl\release\PythonCE-2.5-20061219\Python-2.5-wince\Lib\lib-tk\Tkinter.py", line 38, in <module>
>> RuntimeError: Could not find CeLib DLL
>> >>>
>
>  Which led me to believe something is not right.
>  Has anyone seen that? Does anyone know how to fix that?
>
>  A similar error occurs when I try to install the PocketPyGui
> (ppygui-0.7) which I thought I would use for the GUI part. However the
> exception then has a bit longer stack trace (about 10 frames).
>
>  2. Reading the documentation on the pocketpc-cab and lcab utilities
> I found something that rang a bell:
>
>    Appendix A: a list of processor architectures
>    ...
>    1824 - ARM 720
>    2080 - ARM 820
>    2336 - ARM 920
>    2577 - StrongARM
>    ...
>
>    My device says in the System Properties: 'Intel, ARM920T-PXA27x'
>    Could this be the culprit of my problems? Is ARM920 compatible
> with Strong ARM? Should I give-up on trying to install the current
> version and try to compile a version for my device personally?
>
>  I also noted that the CAB files state, that the allowed OS version
> is 4.00 up to 5.00, shouldn't it be up to 5.99 or something? Not that
> my device has Windows 5.1 or anything, but I saw a the Smart Phone
> version note a MAX OS Version of 5.99...
>
>  I hope I get more feed-back on the subject.
>  I feel I am getting closer, but I am neither a Mobile-Device expert,
> nor a Python expert. I am fairly new to this stuff.
>
>
>


More information about the PythonCE mailing list