Re: PythonCE - I'm a subscriber

Adam Walley <[email protected]> Thu, 10 Feb 2011 19:23:46 +0000
Newsgroups gmane.comp.python.windows-ce
Message-ID <[email protected]>
--===============0355236072==
Content-Type: multipart/alternative; boundary=0015175cd5ba46ed3e049bf28519

--0015175cd5ba46ed3e049bf28519
Content-Type: text/plain; charset=ISO-8859-1

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')
>>>
k=reg.CreateKey(reg.HKEY_CLASSES_ROOT,'Python.File\\Shell\\Open\\Command')
>>> 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...

HTH

Adam

On 10 February 2011 16:23, Ihsan Cingisiz <[email protected]> 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
> [email protected]
> http://mail.python.org/mailman/listinfo/pythonce
>
>

--0015175cd5ba46ed3e049bf28519
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi, Ihsan.<div><br></div><div>Welcome to the list. I am not sure what you m=
ean by programming without the &#39;&gt;&gt;&gt;&#39;s, but I have a feelin=
g that you mean the Python interpreter is not associated with .py files. On=
ce 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 yo=
ur device, and yes you need to use the &#39;&gt;&gt;&gt;&#39;s, but only fo=
r these steps:</div>
<div><br></div><div><div>&gt;&gt;&gt; import _winreg as reg</div><div>&gt;&=
gt;&gt; k=3Dreg.CreateKey(reg.HKEY_CLASSES_ROOT,&#39;.py&#39;)</div><div>&g=
t;&gt;&gt; reg.SetValueEx(k,&#39;Default&#39;,0,reg.REG_SZ,&#39;Python.File=
&#39;)</div>
<div>&gt;&gt;&gt; k=3Dreg.CreateKey(reg.HKEY_CLASSES_ROOT,&#39;Python.File\=
\Shell\\Open\\Command&#39;)</div><div>&gt;&gt;&gt; reg.SetValueEx(k,&#39;De=
fault&#39;,0,reg.REG_SZ,&#39;\&quot;\\Storage Card\\Program=A0Files\\python=
.exe\&quot; \&quot;%1\&quot;&#39;)</div>
<div><br></div>DISCLAIMER: please be aware that modifying the registry can =
cause serious problems with your operating system. Do not undertake any cha=
nges unless you know and understand what you are doing!</div><div><br></div=
>
<div>The above lines of code may get broken through the email and/or mailin=
g list, so check them carefully! Also remember the underscore for the &#39;=
_winreg&#39; module name, and look carefully at the string value you need t=
o enter for the path to the Python.exe file - there are single AND double q=
uotation marks.</div>
<div><br></div><div>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.</div><div><br></div><div>Note that I prefer to =
run my Python executable from an SD card, so the registry path begins with =
&#39;\\Storage Card\\Program Files\\...&#39;, but if your Python.exe is loc=
ated on the main device, the value will probably simply begin &#39;\\Progra=
m Files\\...&#39;.</div>
<div><br></div><div>Alternatively, if you are able to establish an ActiveSy=
nc link with your computer and device, then you can download a registry edi=
tor to make the task easier (e.g. CERegEditor by MDSoft is one, but there a=
re many).</div>
<div><br></div><div>Now, writing and editing .py files is another matter...=
</div><div><br></div><div>HTH</div><div><br></div><div>Adam</div><div><br><=
div class=3D"gmail_quote">On 10 February 2011 16:23, Ihsan Cingisiz <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">ihsan_cingisiz@liv=
e.nl</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">



<div>
Hello,<div><br></div><div>I download PythonCE today because I love programm=
ing in Python, i&#39;m using it on</div><div>my computer and wanted to use =
it on my HTC Touch Pro with Windows Mobile 6.1.</div><div>It work, but only=
 the &#39;IDLE&#39;, I mean this for example:</div>
<div>&gt;&gt;&gt; print &quot;Hello...&quot;</div><div><br></div><div>In Py=
thon PC Version you can do open a new window and program without the &gt;&g=
t;&gt;&#39;s.</div><div>Is that possible in PythonCE too? If it is, how do =
I open it?</div>
<div><br></div><div>Kind Regards,</div><div>I. Cingisiz.</div> 		 	   		  <=
/div>
<br>_______________________________________________<br>
PythonCE mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"http://mail.python.org/mailman/listinfo/pythonce" target=3D"_bla=
nk">http://mail.python.org/mailman/listinfo/pythonce</a><br>
<br></blockquote></div><br></div>

--0015175cd5ba46ed3e049bf28519--

--===============0355236072==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PythonCE mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pythonce

--===============0355236072==--