[PythonCE] PythonCE - I'm a subscriber

Adam Walley adam.walley at gmail.com
Thu Feb 10 20:23:46 CET 2011

Hi, Ihsan.

Welcome to the list. I am not sure what you mean by programming without the
'>>>'s, but I have a feeling that you mean the Python interpreter is not
associated with .py files. Once the association is created in the registry,
you can launch .py files. I use WM5, but I think WM6.1 will probably let you
do this too. To create the association in the registry you need to start the
Python interpreter on your device, and yes you need to use the '>>>'s, but
only for these steps:

>>> import _winreg as reg
>>> k=reg.CreateKey(reg.HKEY_CLASSES_ROOT,'.py')
>>> reg.SetValueEx(k,'Default',0,reg.REG_SZ,'Python.File')
>>> reg.SetValueEx(k,'Default',0,reg.REG_SZ,'\"\\Storage
Card\\Program Files\\python.exe\" \"%1\"')

DISCLAIMER: please be aware that modifying the registry can cause serious
problems with your operating system. Do not undertake any changes unless you
know and understand what you are doing!

The above lines of code may get broken through the email and/or mailing
list, so check them carefully! Also remember the underscore for the
'_winreg' module name, and look carefully at the string value you need to
enter for the path to the Python.exe file - there are single AND double
quotation marks.

When you have completed the above steps, you should be able to launch a
simple .py file containing Python code without needing to open the
interpreter first.

Note that I prefer to run my Python executable from an SD card, so the
registry path begins with '\\Storage Card\\Program Files\\...', but if your
Python.exe is located on the main device, the value will probably simply
begin '\\Program Files\\...'.

Alternatively, if you are able to establish an ActiveSync link with your
computer and device, then you can download a registry editor to make the
task easier (e.g. CERegEditor by MDSoft is one, but there are many).

Now, writing and editing .py files is another matter...



On 10 February 2011 16:23, Ihsan Cingisiz <ihsan_cingisiz at live.nl> wrote:

>  Hello,
> I download PythonCE today because I love programming in Python, i'm using
> it on
> my computer and wanted to use it on my HTC Touch Pro with Windows Mobile
> 6.1.
> It work, but only the 'IDLE', I mean this for example:
> >>> print "Hello..."
> In Python PC Version you can do open a new window and program without the
> >>>'s.
> Is that possible in PythonCE too? If it is, how do I open it?
> Kind Regards,
> I. Cingisiz.
> _______________________________________________
> PythonCE mailing list
> PythonCE at python.org
> http://mail.python.org/mailman/listinfo/pythonce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonce/attachments/20110210/aa4c48c6/attachment.html>

More information about the PythonCE mailing list