From ihsan_cingisiz at live.nl Thu Feb 10 17:23:37 2011 From: ihsan_cingisiz at live.nl (Ihsan Cingisiz) Date: Thu, 10 Feb 2011 17:23:37 +0100 Subject: [PythonCE] PythonCE - I'm a subscriber Message-ID: Hello, I download PythonCE today because I love programming in Python, i'm using it onmy 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.walley at gmail.com Thu Feb 10 20:23:46 2011 From: adam.walley at gmail.com (Adam Walley) Date: Thu, 10 Feb 2011 19:23:46 +0000 Subject: [PythonCE] PythonCE - I'm a subscriber In-Reply-To: References: Message-ID: 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 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: From tad.3333 at gmail.com Sat Feb 12 07:50:45 2011 From: tad.3333 at gmail.com (TURKI ALDAHAYAN) Date: Sat, 12 Feb 2011 01:50:45 -0500 Subject: [PythonCE] I need help with Python please Message-ID: *Hello Sir or Madam,* * * *I am a student, and I have a computer class. We use Python?s program there, but I didn?t understand it at all.* * * *I have some assignments to do them, but I couldn?t.* * * *Could you help me with them please?* * * * * *Best Regards,* *TURKI * * * * * * * -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuber_gautam at hotmail.com Sat Feb 12 15:21:05 2011 From: kuber_gautam at hotmail.com (kuber datt gautam) Date: Sat, 12 Feb 2011 19:51:05 +0530 Subject: [PythonCE] I need help with Python please In-Reply-To: References: Message-ID: how python will install at any symbenian based mobile "Love is just like life, its not always easy and does not always bring happiness but when we do not stop living why should we stop loving" KUBER DATT GAUTAM Lecturer,(MCA) Medi-Caps Institute of Technology & Management Pidmber,Near Raw Indore 98270-71843 > From: pythonce-request at python.org > Subject: PythonCE Digest, Vol 83, Issue 2 > To: pythonce at python.org > Date: Sat, 12 Feb 2011 12:00:02 +0100 > > Send PythonCE mailing list submissions to > pythonce at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/pythonce > or, via email, send a message with subject or body 'help' to > pythonce-request at python.org > > You can reach the person managing the list at > pythonce-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of PythonCE digest..." > > > Today's Topics: > > 1. I need help with Python please (TURKI ALDAHAYAN) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 12 Feb 2011 01:50:45 -0500 > From: TURKI ALDAHAYAN > To: PythonCE at python.org > Subject: [PythonCE] I need help with Python please > Message-ID: > > Content-Type: text/plain; charset="windows-1252" > > *Hello Sir or Madam,* > * > * > *I am a student, and I have a computer class. We use Python?s program there, > but I didn?t understand it at all.* > * > * > *I have some assignments to do them, but I couldn?t.* > * > * > *Could you help me with them please?* > * > * > * > * > > > > *Best Regards,* > *TURKI * > * > * > * > * > * > > * > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > > End of PythonCE Digest, Vol 83, Issue 2 > *************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From banibrata.dutta at gmail.com Sun Feb 13 06:46:55 2011 From: banibrata.dutta at gmail.com (Banibrata Dutta) Date: Sun, 13 Feb 2011 11:16:55 +0530 Subject: [PythonCE] I need help with Python please In-Reply-To: References: Message-ID: This is PythonCE list (i.e. Python for WindowsCE platform). Google for Symbian+Python and I'm sure the correct results will be right at the top. On Sat, Feb 12, 2011 at 7:51 PM, kuber datt gautam wrote: > how python will install at any symbenian based mobile > > *"Love is just like life, its not always easy and does not always bring > happiness but when we do not stop living why should we stop loving" > * > * KUBER DATT GAUTAM* > * Lecturer,(MCA)* > * Medi-Caps Institute of Technology & Management* > * Pidmber,Near Raw Indore* > *98270-71843* > > > > > > > > From: pythonce-request at python.org > > Subject: PythonCE Digest, Vol 83, Issue 2 > > To: pythonce at python.org > > Date: Sat, 12 Feb 2011 12:00:02 +0100 > > > > Send PythonCE mailing list submissions to > > pythonce at python.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://mail.python.org/mailman/listinfo/pythonce > > or, via email, send a message with subject or body 'help' to > > pythonce-request at python.org > > > > You can reach the person managing the list at > > pythonce-owner at python.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of PythonCE digest..." > > > > > > Today's Topics: > > > > 1. I need help with Python please (TURKI ALDAHAYAN) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Sat, 12 Feb 2011 01:50:45 -0500 > > From: TURKI ALDAHAYAN > > To: PythonCE at python.org > > Subject: [PythonCE] I need help with Python please > > Message-ID: > > > > Content-Type: text/plain; charset="windows-1252" > > > > *Hello Sir or Madam,* > > * > > * > > *I am a student, and I have a computer class. We use Python?s program > there, > > but I didn?t understand it at all.* > > * > > * > > *I have some assignments to do them, but I couldn?t.* > > * > > * > > *Could you help me with them please?* > > * > > * > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.walley at gmail.com Mon Feb 14 11:32:40 2011 From: adam.walley at gmail.com (Adam Walley) Date: Mon, 14 Feb 2011 10:32:40 +0000 Subject: [PythonCE] PythonCE - I'm a subscriber In-Reply-To: References: Message-ID: Hello, Ihsan. In general, I find it easier to develop my code on one of my main systems rather than directly on the mobile device (to transfer and test it on the device I would then use ftp or a usb cable and activesync). However, if you want to code and test directly on the mobile device, I suggest the following steps (this is more of a workaround than a solution, but it works reasonably well): - create three plain text files on your device >>> f=open("/yourpath/infile.txt","wb") >>> f.write("mycode") >>> f.close() >>> f=open("/yourpath/mycode.txt","wb") >>> f.write("# python code\r\n") >>> f.close() >>> f=open("/yourpath/txt2py.txt","wb") >>> f.write("# txt2py renaming utility\r\n") >>> f.close() (note: when in the python interpreter, you can tap a line you have already typed and press enter/return, and it will appear at the '>>>' prompt so you can modify it and enter it again - this is quicker than typing the whole line again) - now close python and open the 'txt2py.txt' file with the Windows Mobile text editor (Notes or Word, I think), but remember that when you save the file you must NOT let Notes change the format. Because it is a text file, just tapping it should open it in the default editor. Enter the following python code in the text editor: f=open("infile.txt","rb") fname=f.read() f.close() print "opening:",fname+".txt" f=open(fname+".txt","rb") fdat=f.read() f.close() print "saving:",fname+".py.py" f=open(fname+".py.py","wb") f.write(fdat) f.close() Now back in python: >>> f=open("/yourpath/txt2py.txt","rb") >>> fdat=f.read() >>> f.close() >>> f=open("/yourpath/txt2py.py.py","wb") >>> f.write(fdat) >>> f.close() That's it! Now you can modify the 'mycode.txt' file in your text editor. When you have saved it you can run the 'txt2py' tool to make a copy of the file with the '.py.py' extension. Why the double extension? This is just a simple workaround to make your python files more visible, because Windows Mobile hides the file extension. By using a simple text file to hold the root of the filename to convert in 'infile.txt' you can easily modify the name so 'txt2py' can rename any '.txt' file to a '.py.py' file. Once you have one text file created, you can create a new text file by doing copy & paste, then renaming it. Note that the suggestion I am making assumes you are working with all your files in the same folder. Of course, once you have it all working, you can work on improving the code. For example, you could create a 'py2txt' tool. This is just my suggestion. Others on the list may have better ideas(?). Adam On 13 February 2011 22:59, Ihsan Cingisiz wrote: > Hello, > > I did all of this: > >>> 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\"') > > But I need help with editing and creating a .py file.. > Can you please help me? > > Thanks! > > K. Regards, > Ihsan. > > ------------------------------ > Date: Thu, 10 Feb 2011 19:23:46 +0000 > From: adam.walley at gmail.com > To: pythonce at python.org > Subject: Re: [PythonCE] PythonCE - I'm a subscriber > > > 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 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 > > > > _______________________________________________ PythonCE mailing list > PythonCE at python.org http://mail.python.org/mailman/listinfo/pythonce > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ssb22 at cam.ac.uk Mon Feb 14 13:20:22 2011 From: ssb22 at cam.ac.uk (Silas S. Brown) Date: Mon, 14 Feb 2011 12:20:22 +0000 Subject: [PythonCE] Sending SMS messages from PythonCE Message-ID: <20110214122022.GA16192@soup.linux.pwf.cam.ac.uk> Hi, I wonder if you'd like to add this to the examples. It's a Python function to send an SMS message (text message) from PythonCE. Tested on Windows Mobile 6.0 Smartphone, should work on most others. Took me a while to figure out and I thought others might benefit. import ctypes import ctypes.wintypes as wintypes def send_SMS_message(number, unicode_text): handle = wintypes.DWORD() ret = ctypes.cdll.sms.SmsOpen(u"Microsoft Text SMS Protocol", wintypes.DWORD(2),ctypes.byref(handle),None) if not (ret==0 and handle): raise Exception("SmsOpen error") class SMSaddress(ctypes.Structure): _fields_ = [("smsatAddressType",ctypes.c_int), ("ptsAddress",ctypes.c_wchar * 256)] unicode_text = u"" + unicode_text # make sure it's Unicode ret = ctypes.cdll.sms.SmsSendMessage(handle,None, ctypes.byref(SMSaddress(0,number)),None,unicode_text, wintypes.DWORD(2*len(unicode_text)),"\0\0\0\0\3\0\0\0\0\0\0\0", wintypes.DWORD(12),ctypes.c_int(0),wintypes.DWORD(0),None) if not ret==0: raise Exception("SmsSendMessage error") ctypes.cdll.sms.SmsClose(handle) Thanks. Silas PS: Thanks for developing PythonCE, much appreciated. I'm using it for my language-learning program and front-end to eSpeak speech synth http://people.pwf.cam.ac.uk/ssb22/gradint/ among other things. -- Silas S Brown http://people.pwf.cam.ac.uk/ssb22 From antovar at gmail.com Mon Feb 14 14:57:57 2011 From: antovar at gmail.com (Antonio Tovar) Date: Mon, 14 Feb 2011 14:57:57 +0100 Subject: [PythonCE] PythonCE Digest, Vol 83, Issue 4 In-Reply-To: References: Message-ID: Hi, >> >> But I need help with editing and creating a .py file.. >> Can you please help me? >> I use nebopad. It creates files with any extension (like .py) and it is multifile, so you can copy/paste between source files. There are some other editors, like PocketNotepad.