Re: How to edit registry on pocketpc to change how IE displays python files.

Fuzzyman <[email protected]>
Newsgroups gmane.comp.python.windows-ce
Message-ID <[email protected]>
Fuzzyman wrote:

> Thomas Heller wrote:
>
>>Fuzzyman <[email protected]> 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).
>

Hmm... for some reason I misread this post and thought we were talking
about Tk/Tkinter. Sorry about that.

Anyway, I still have a problem - but I can always manually add the
registry entries.

All the best,

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

> All the best,
>
>
> Fuzzyman
> http://www.voidspace.org.uk/python/index.shtml
>
>
>
>>Thomas
>>
>>
>>
>>  
>>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>PythonCE mailing list
>[email protected]
>http://mail.python.org/mailman/listinfo/pythonce
>  
>

_______________________________________________
PythonCE mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pythonce
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.