How to install ?!?

  • Garry

    (This reply is probably too late for you, but maybe it'll help others.)  I managed to install python and tkinter using the files and dated 2004-07-21.  I'm not a windows ce expert or a python expert, so this isn't necessarily the best way to do it, but it worked for me:

    On your PocketPC, create the directory:
    \Program Files\Python\Lib

    Unzip on your desktop PC, and copy all of the files it contains to:
    \Program Files\Python\Lib
    on your Pocket PC.

    Using the PocketPC file explorer, click on the following shortcut:
    \Program Files\Python\Lib\Setup Registry
    Which runs the Setup script and installs the necessary registry entires to associate .py files with python.

    Python is now installed.  You can run it by clicking on the python exectuable (ie. \Program Files\Python\Lib\python) or by clicking on any .py file in the file explorer.  You might also want to add it to your start menu, by selecting the executable in the file explorer, and choosing "copy" from the context menu, and then going to the directory:
    \Windows\Start Menu\Programs
    and choosing "paste shortcut" from the context menu.

    Note: one thing that confused me at this point, is that if python is already running, clicking a .py file in file explorer will switch to the existing instance of python but will not run the script you have clicked on.  If this happens, just exit the existing instance (by using Exit in the File menu) and try again.

    Installing Tkinter was a little more tricky, but should be easy if you follow these instructions.

    First unzip on your desktop PC.

    The zip file contains the following directories:

    You should copy the contents of these directories to the following directories on the PocketPC:

    tcl8.4.3\library -> \Program Files\Python\Lib\tcl8.4
    tcl8.4.3\tk8.4 -> \Program Files\Python\Lib\tk8.4
    Windows -> \Windows

    The only problem now was that python couldn't import Tkinter, because it's default module paths didn't include it.  There is probably a proper way to fix this, but I get around it by starting all of my Tkinter programs with:

    import sys
    sys.path += ['\\Program Files\\Python\\lib\\\\lib-tk']

    from Tkinter import *


  • Danny Staple
    Danny Staple

    Thanks for that. Might it be possibly something you can add to the setup registry file? I have no idea about environment variables on the pocket pc - or if they even exist.

  • vigorous_one

    Everything for the most part was straight forward except
    tcl8.4.3\library -> \Program Files\Python\Lib\tcl8.4

    which means
    tcl8.4.3\library\* -> \Program Files\Python\Lib\tcl8.4

    #a test application
    import sys
    sys.path += ['\\Program Files\\Python\\lib\\\\lib-tk']
    from Tkinter import *
    # create a label widget and add it to the root window
    w = Label(0, text="Hello, world!") # 0 => no parent window
    # start processing user events

  • leo

    After installing all as mentioned it is impossible to run the script "Setup Registry" as
    it is a .py file not yet associated to intrepreter. A solution ? thanks

    • Luke Dunstan
      Luke Dunstan

      1. Run PythonCE
      2. execfile('\\program files\\python\\')

  • leo

    Thanks for last info. Really the problem is that it's necessary to install Python in the default "Program Files" folder otherwise the Startup Registry file doesn't find the Python exe to execute ".py" files.

  • Snake

    I was able to install python and the windows extensions on my pocket pc. But I wasn't able to install/build the win32com module. Any suggestions?