[PythonCE] How to edit registry on pocketpc to change how IE displays python files.

Fuzzyman fuzzyman at voidspace.org.uk
Wed Jan 18 11:55:19 CET 2006


Thomas Heller wrote:

>Fuzzyman <fuzzyman at voidspace.org.uk> writes:
>
>  
>
>>Stewart Midwinter wrote:
>>
>>    
>>
>>>David, there should be a script that edits the registry for you, and
>>>it comes with a shortcut to help run it.  Which version of PythonCE
>>>did you install?
>>>
>>>
>>> 
>>>
>>>      
>>>
>>It didn't work for me. The one supplied seem to need running on the PC
>>(using cereg.exe)  not the PocketPC - and it defines various *extra*
>>entries as well. It didn't work for me yet anyway.
>>
>>I haven't yet taken the manual steps described to get it working. I was
>>re-installing over a previous install.
>>    
>>
>
>Here is the script that I used (maybe it is from Luke):
>
>#
>#	Setup the registry to allow us to double click on python scripts
>#
>from _winreg import *
>
>print "Setting up registry to allow\ndouble clicking of Python files to work"
>
>#
>#	Create the registry entries for ".py" and ".pyc" extensions
>#
>for Name in (".py", ".pyc"):
>    Key = CreateKey(HKEY_CLASSES_ROOT, Name)
>    SetValue(Key, None, REG_SZ, "Python.File")
>    CloseKey(Key)
>
>#
>#	Create HKEY_CLASSES_ROOT\Python.File\Shell\Open\Command = "\Program Files\Python\Python.exe" "%1"
>#
>Key = CreateKey(HKEY_CLASSES_ROOT, "Python.File")
>for Name in ("Shell","Open","Command"):
>  New_Key= CreateKey(Key, Name)
>  CloseKey(Key)
>  Key = New_Key
>SetValue(Key, None, REG_SZ, "\"\\Program Files\\Python\\Python.exe\" \"%1\"")
>CloseKey(Key)
>
>import time
>time.sleep(5)
>
>I did run it with 'execfile(r"\My Documents\Scripts\setup-registry.py")'
>on the pocket PC itself, from within Python.
>
>What I didn't achieve so far was to associate a useful icon with .py
>files, maybe someone could post the registry entries for that?
>
>  
>
This associates '.py' with Python. There was a separate distribution of
Tk/Tkinter posted to the group recently (or at least a URL).

This was purportedly more recent than other versions available for
download. This distribution had a Tcl script to transfer the files to
the PocketPC, this script 'hung' on me, so I followed the manual
instructions. As part of this it included a batch file (that needed
editing appropriately) to setup the registry entries on the PocketPC so
that Python can find the install of Tk.

It uses ``cereg.exe`` run on the PC (AFAICT) to make the registry
entries. It's possible of course that it ought to be run on the PocketPC
- maybe I'll try that. (It certainly didn't work for me, but then it
didn't report errors either, which you would expect if you try to run a
PocketPC application on the desktop).

All the best,


Fuzzyman
http://www.voidspace.org.uk/python/index.shtml



>Thomas
>
>
>
>  
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonce/attachments/20060118/0c9394cd/attachment.html 


More information about the PythonCE mailing list