Re: [PythonCE] Accessing serial port with PythonCE 2.5
Hello, Just to add to my previous message, the ceserial module uses ctypes to access the same functionality which would be used by a WinCE application written in VB or C#. I have just checked and Microsoft appear to still have the reference pages available, so you may find that the following link can guide you in checking the serial communications: https://msdn.microsoft.com/en-us/library/aa450503.aspx (I am assuming WinCE version 5.0, but I think WinCE 6.0 and later versions will also be available) For checking your device is communicating as expected, you could try to use a third party terminal program that can also access the serial port. I recall using vxHpc and also PocketPuTTY. These can be installed directly onto the WinCE device and allow you to test the serial port. Then you can try connecting the WinCE device directly to a computer to check communication settings are correct, then connect your serial device directly to a computer (just the regular troubleshooting steps really). Good luck AdamW On 16 December 2015 at 09:11, Rushali Watanewrote: > Hi, > > Please do help me. I have tried with this essential step but not able to > read the data. > Please do needful. > > Regards > Rushali > > > ___ > PythonCE mailing list > PythonCE@python.org > https://mail.python.org/mailman/listinfo/pythonce > ___ PythonCE mailing list PythonCE@python.org https://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] Accessing serial port with PythonCE 2.5
Hello, I thought I would send a short comment, as I have used the ceserial module (a long time ago) for my HP iPaq running PythonCE 2.5. I recall that the ceserial module tries to implement what the standard serial module does for Python, but depending on the actual version of ceserial used there may be some small differences in the naming of the of the properties and variables. It is worth verifying in the ceserial module that it is actually settings the parameters as expected for the serial port object. That aside, I would also say that a PARITY_EVEN setting would be unusual these days and that PARITY_NONE is more common. I think I also found that the stopbits setting did not set the port as expected. Sorry to not have a definite answer, but an oscilloscope will show you what the device is trying to do. Finally, perhaps the device you are connecting to is expecting the DTR line to change? AdamW On 15 December 2015 at 05:30, Rushali Watanewrote: > Stefan Johansson yahoo.com> writes: > > > > > You can find a link to ceserial in the archives: > > http://mail.python.org/pipermail/pythonce/2006-September/001589.html > > I have used it successfully on my Dell Axim. > > > > Stefan > > > > - Original Message > > From: David Goncalves lestat.st> > > To: Luke Dunstan hotmail.com> > > Cc: pythonce python.org > > Sent: Monday, January 8, 2007 4:08:58 PM > > Subject: Re: [PythonCE] Accessing serial port with PythonCE 2.5 > > > > Hi, > > > > > Well there is no "serial" module included with PythonCE, but Python > on > > > my PC doesn't have such a module either. I haven't done it myself on > > > PythonCE but I think the best way would be to use ctypes to access > the > > > Win32 serial communications APIs. I have written some code to do > this on > > > the PC, so I have attached it. > > > > Thanks for your code ;) I'll try it and give feedback. > > > > I've seen about people usin "ceserial" that seems to be a port of > > PySerial on WinCE. But no way to find it somewhere on the net :( > > ___ > > PythonCE mailing list > > PythonCE python.org > > http://mail.python.org/mailman/listinfo/pythonce > > > Hi, > I am trying to read the data from serial port using python 2.5 with > ceserial module on windows CE 5.0. When i am trying to run, it is get > connected to port, but it is not reading the data from the port.Below is > my code - > > from time import sleep > import ceserial > > ser = > ceserial.Serial(port="COM1:",baudrate=9600,bytesize=8,stopbits=ceserial. > STOPBITS_ONE,parity=ceserial.PARITY_EVEN) > > print("connected to: " + ser.portstr) > > #data = '' > while True: > data = ser.read() > if len(data) > 0: > print 'Got:', data > sleep(0.5) > #print 'not blocked' > > ser.close() > > > > ___ > PythonCE mailing list > PythonCE@python.org > https://mail.python.org/mailman/listinfo/pythonce > ___ PythonCE mailing list PythonCE@python.org https://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] Installing python on Windows CE 7.0 device.
Hi Sachin, Was wondering if you got this working? I would be interested to know whether it can be done for WinCE 7.0. Regarding the error with COREDLL.dll, if you are lucky this is just an issue with upper/lowercase. You could try renaming your COREDLL.dll file to coredll.dll, or Coredll.dll Unfortunately, I suspect that the problem may be more than just the above. Adam On 13 June 2012 16:22, Kendale, Sachin (GE Healthcare) sachin.kend...@ge.com wrote: Hi, ** ** I’m using PythonCE-25-20061219.PPC2003_ARM.CAB file to install python on Windows CE 7.0 device. I modified CAB file to support CE 7.0 version for all processor types (Not just mobile). ** ** I had to modify CAB file because I was getting “Setup failed” error while attempting to install it on Windows CE 7 device. After modification, “Setup failed” error disappeared but now I get following error. ** ** Unable to import library COREDLL.dll. ** ** I’m trying to install it for QSB board with Springdale, Freescale i.MX53 (ARM7) processor. ** ** Any help would be greatly appreciated ** ** Thanks, Sachin ** ** ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] Input problem
Hello, Ivan. Welcome to PythonCE. From your message, I think your script is probably working fine. The problem is that blasted dialog, which is covering your output. A very simple workaround is to add a few blank lines before printing your x value, so that it appears below the dialog (I know this works on a PDA, but maybe the screen size is different on a mobile phone?). Your code might look like: x = input(Enter value) print 10*\r\n # prints 10 blank lines print x raw_input(Enter for exit) Alternatively, you might want to add a short pause before the exit: import time x = input(Enter value) print x time.sleep(2) # wait 2 seconds raw_input(Enter for exit) HTH Adam 2011/4/21 Ivan Ševčík dark-rav...@hotmail.com I am started a weeak ago with python, and yesterday I wodnloaded for my mobile. However I feel that something got wrong. The problem is that when I run a script on computer that requires input, prints something and agains require input (that second just prevents from script closing before reading output), i get what I want - example : Enter value10 10 Enter for exit That's not the case with pythonCE. It creates dialog, I enter value, nothing is printed out and I am again prompted for exit. I find that quite strange as it's the very same code and it acts like after input is output or all commands ignored. My code: x = input(Enter value) print x raw_input(Enter for exit) Thanks for help as this is an issue I can't move along with.. ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
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 ihsan_cingi...@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@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
[PythonCE] PythonCE and SSL
Success! Using the TLSLite package I was able to achieve what I was aiming for - that is to access Gmail programmatically from PythonCE. For anyone interested, this is how I got there (after quite a bit of puzzling and trawling through the net): Having downloaded the TLSLite-0.3.8 package, I placed the 'tlslite' folder into my 'Lib/site-packages' without any modifications. Now it would be accessible to any of my PythonCE scripts. Next, I wrote the following script: -- Example PythonCE code -- import base64, string from tlslite.api import * user=anyuser passwd=whatever h=HTTPTLSConnection(mail.google.com,443) auth=Basic +string.strip(base64.encodestring(user+:+passwd)) h.putrequest(GET,/mail/feed/atom) h.putheader(Authorization,auth) h.endheaders() r=h.getresponse() txt=r.read() msgs=txt[txt.index(fullcount)+11:txt.index(/fullcount)] raw=raw_input(inbox(+msgs+)) -- Example PythonCE code -- the above simply connects on port 443 (https) to the Gmail atom feed and returns an XML message about new messages in the inbox, which is then searched for the number of new messages. It's not the fastest thing in the world, but it works. Adam. ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] How to determine special folder location
Nice work. I will definitely make a note of that one. Thanks rodi. Adam. On 29 March 2010 23:02, rodi c2...@web.de wrote: Hello PytonCE users, have solved the question. The appropriate function is 'SHGetSpecialFolderPath': see http://msdn.microsoft.com/en-us/library/aa931257.aspx May be this info and the follwing code snippet is helpfull to others :) import ctypes from time import sleep HANDLE = ctypes.c_ulong HWND = HANDLE INT = ctypes.c_int BOOL = ctypes.c_int SHGetSpecialFolderPath = ctypes.windll.coredll.SHGetSpecialFolderPath # BOOL SHGetSpecialFolderPath( HWND hwndOwner, LPTSTR lpszPath, int nFolder, BOOL fCreate ); SHGetSpecialFolderPath.argtypes = [HWND, ctypes.c_wchar_p, INT, BOOL] MAX_PATH = 260 path = ctypes.create_unicode_buffer(MAX_PATH) for i in range(0, 60): #[CSIDL_STARTMENU, CSIDL_PROGRAMS]: try: SHGetSpecialFolderPath( 0, path, i, 0) if len(path.value)0: print i, path.value else: print i, 'not supported' except Exception, e: print i, 'exception', e sleep(5) Cheers rodi. ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] Beginner Questions
Welcome, Christopher! I hope you like what you have seen so far with Python and PythonCE. To answer your questions: - Yes, the setup executable is intended to work through Activesync, so next time you connect Activesync will do the install on your device for you. - Running the setup executable directly on your device will not work (because it is compiled to run on a PC and then transfer through Async). To install directly on your device you need a CAB package (I seem to have one for PythonCE 2.5 in my original install files so it is probably available out there somewhere). - PythonCE is definitely not only for smartphones, although that is a popular use for it. Any platform that runs Windows CE or Windows Mobile should (hopefully) let you run PythonCE without any problems. PythonCE will not run on Symbian or Android phones because PythonCE needs Microsoft's operating system - there may be other Python packages for these platforms (but that's not anything to do with this list). - Your objectives are not unreasonable, although depending on your exact requirements you may find stand-alone to be a sticking point; the target device will need to have PythonCE installed before any scripts will run on it, and there is no method for making a single executable file from your script (as you might do with a C compiler, for example). - Java and C experience will certainly be useful. - Documentation is mainly what you find on the wiki and sourceforge pages, as well as the main Python pages (most things are implemented the same way in PythonCE). Many things are covered in this list. I have some personal pages I put together, which may be of interest - including how to record from the built-in microphone and save out to a WAV file, as well as stylus input. There is also information about using the system's notifications to schedule a script to run at a certain time. Take a look here: http://watersprite.awardspace.com/python Happy Python-ing! Adam On 14 March 2010 00:36, Christopher Gray ch...@bayareadigital.us wrote: Hello: I am new to Python and even newer to PythonCE. Here are a couple of relatively elementary questions. I found what looks to be the newest download called pythoncesetup.exe. It ran on my PC under Windows XP and upon finishing says it will install PythonCE the next time I attach my PDA. Is this done somehow through ActiveSync? I tried running pythoncesetup.exe on my PDA directly using a thumb drive. I got an error that the program was not a valid win32 application. Is this expected behavior? On the Python wikki, I found a lot of files that seem to be a smartphone application. Is PythonCE only for smartphones? What about Symbian phones or the Google phone and droids? Right now, I'm mostly learning Python using the ActiveState Python 2.6 on a PC running XP and Ubuntu Linux. My longer term objectives are to: Create stand-alone applications on mobile phones that allow blind, visually impaired and numeracy impaired people to gather data from medical equipment and have it spoken from their cell phones or PDAs Explore the use of PythonCE on a braille PDA running Windows CE 6. Do these seem like reasonable objectives? I have experience programming in Java and C, assisted in the implementation of the FORTH language on a braille-based PDA, so am not a complete stranger to this work. Any advice, particularly pointers to documentation, would really be appreciated. Thanks. Chris Christopher Gray, President Bay Area Digital Promoting good health with innovative technology and superior health products 870 Market Street, #653 San Francisco, CA 94102 Phone: (415) 217-6667 fax:(415) 962-2520 Email: ch...@bayareadigital.us Visit my blog at http://ChristopherGray.squarespace.com Visit me on Facebook by linking to http://www.facebook.com/cpgray ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] kbhit type of functionality in PythonCE
Hi, Cazaw. Welcome to PythonCE. I remember wrestling with similar issues with the raw_input. AFAIK its features are very limited and it does rather awkwardly appear over the PythonCE window. You can, of course, position your text output with some spacing. If you are satisfied with just a pause before the raw_input window appears then you can import the time module and use the sleep function (although this tends to make the OS think the app is not responding). I usually create a simple loop function instead, when using this method. It would define a pause function and look something like this: def pause(t): t0=time.time() while time.time()-t0t: pass where 't' is the number of seconds to pause (and can be a decimal if needed). Then you just call the pause function at the point in your code where you want to wait. Unfortunately, I think that any other method whereby (hard or soft) key or stylus input is used would be non-trivial and requires quite a bit more effort. If you have the time to put into it, I would suggest looking into the PocketPyGUI package or compiling the SDL library and using that (I have some info on using SDL with PythonCE here: watersprite.awardspace.com/python). Perhaps other list members have some other suggestions? Adam. 2009/10/29 Cazaw cazaw_...@yahoo.com p.s. - Alternately, if the raw_input could show up in the stdout along with the displayed results instead of it's own dialog box, that would be just fine and eliminate the problem. Whichever way would be easiest. -- View this message in context: http://www.nabble.com/kbhit-type-of-functionality-in-PythonCE-tp26114814p26119052.html Sent from the Python - pythonce mailing list archive at Nabble.com. ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] PythonCE Digest, Vol 69, Issue 1
Nice find. Will check it out. Adam 2009/5/8 Tony Lee tony.p@gmail.com Found this reference in http://markmail.org/message/cqi5g3b5ct3763fq Tried it and it worked beautifully. Love Python. Now need to see if the bluetooth works. BTW, I am using Samsung's blackjack 2. Hello, Tony. Glad to hear PythonCE works well on WM6. I think there is a Python telnetlib module, but have not used it myself - you may need to write something to get it to do what you want. Perhaps there is also an SSH module that works on PythonCE? Alternatively, you could use the CERDisp utility. It provides a remote display of your mobile device on a laptop or workstation, but it also provides remote control (i.e. what you type on your *large keyboard* appears on your mobile device's screen). This utility works reasonably well, but I have found it to be a little unstable (eventually it will fall over and you will need to reset the device). I personally use the FreeFloat FTP server to transfer files to my mobile device. I write my code so that each function contains Python and PythonCE variants (the sys.platform value tells Python which version of the code to use). Good luck and let us know what you find. Adam 2009/5/8 Tony Lee tony.p@gmail.com I installed pythonce on my WM6. It works good! ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] Is there a script that would let me do this?
Hello, Tony. Glad to hear PythonCE works well on WM6. I think there is a Python telnetlib module, but have not used it myself - you may need to write something to get it to do what you want. Perhaps there is also an SSH module that works on PythonCE? Alternatively, you could use the CERDisp utility. It provides a remote display of your mobile device on a laptop or workstation, but it also provides remote control (i.e. what you type on your *large keyboard* appears on your mobile device's screen). This utility works reasonably well, but I have found it to be a little unstable (eventually it will fall over and you will need to reset the device). I personally use the FreeFloat FTP server to transfer files to my mobile device. I write my code so that each function contains Python and PythonCE variants (the sys.platform value tells Python which version of the code to use). Good luck and let us know what you find. Adam 2009/5/8 Tony Lee tony.p@gmail.com I installed pythonce on my WM6. It works good! I wonder if there is a simple script that can act as a console that takes input from the port (telnet) and output the data to the port also. Like a io redirection, so I can just telnet to the WM6 to do script development instead of typing on the tiny keyboard. ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
[PythonCE] pygameCE / SDL question
Hi, all. Apologies if this post is a little off PythonCE topic, but I am not sure where in the SDL groups I might send it. I thought Rene might have some ideas? Having had some success in getting some basic things working using PythonCE and the SDL library, I decided to persevere. Having recently started using VS2008, I was finally able to get the SDL library for winCE compiled. My previous tests all work with this new library (now version 1.2.13), and at least I know what functions have been included and should be available to PythonCE. My question is about what happens when an SDL window is initialised. Previously, using the knakos library, I was able to initialise a window which did not occupy the entire screen. However, using my new library, it seems that I am forced to use fullscreen only. This is perhaps not such a great problem for most pygame applications, but it really bugs me that the non-fullscreen method no longer works. I think that the knakos library uses some 'tricks' to allow the SDL screen to be defined as any rectangle within the device's display. Could somebody explain, how this is achieved, and how much work might be involved in modifying my 'vanilla' library to do the same? Adam. ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygameCE / SDL question
Hi, Jared. No, no changes. I simply compiled using the Visual files supplied in the download. I then ran my demo sliding tile app (exactly the same script with a single change to point to the new DLL) and it all works, but in fullscreen only. That is why I suspect there may be some 'adjustments' made to the knakos library, or possibly the newer SDL version has changed some of its default behaviour. Which version did you compile? The knakos one is 1.2.6, and my latest one is 1.2.13. Adam. 2008/9/24 Jared Forsyth [EMAIL PROTECTED] I've compiled a version of SDL (granted, its not the latest one) -- but non-fullscreen works out of the box. Did you make any modifications to the core library in porting it? On Wed, Sep 24, 2008 at 7:26 AM, Adam Walley [EMAIL PROTECTED]wrote: Hi, all. Apologies if this post is a little off PythonCE topic, but I am not sure where in the SDL groups I might send it. I thought Rene might have some ideas? Having had some success in getting some basic things working using PythonCE and the SDL library, I decided to persevere. Having recently started using VS2008, I was finally able to get the SDL library for winCE compiled. My previous tests all work with this new library (now version 1.2.13), and at least I know what functions have been included and should be available to PythonCE. My question is about what happens when an SDL window is initialised. Previously, using the knakos library, I was able to initialise a window which did not occupy the entire screen. However, using my new library, it seems that I am forced to use fullscreen only. This is perhaps not such a great problem for most pygame applications, but it really bugs me that the non-fullscreen method no longer works. I think that the knakos library uses some 'tricks' to allow the SDL screen to be defined as any rectangle within the device's display. Could somebody explain, how this is achieved, and how much work might be involved in modifying my 'vanilla' library to do the same? Adam. ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
Hi, Rene. Thanks for the clarification on pygame-ctypes. The link where I found the SCUMMVM SDL libraries is here: http://users.uoa.gr/~knakos/scummvm/libraries/release-0-10-0/wince-gcc-libs.tar.bz2 There are a number of files in there, including a .diff file which may shed some light on some of the difficulties in compiling the SDL libraries. The SDL version used is 1.2.6. I believe the latest one is 1.2.13, but I think this should not be a big issue to update later. As far as my progress goes, I have got a small pythonCE script running, which draws some coloured squares to the screen (kind of like one of the slide transition effects in powerpoint). The busy indicator no longer interferes with the display :D Now, I am working on a bit of code to allow user input. I am adapting the code to allow key presses of the PDA's hardware function keys to be detected. I would like this to be a small module that can be used in PythonCE to get the scancode from any key press (from the SIP or the hardware keys). I know that SDL provides this, but I am not sure if it will allow the hardware keys to be detected. From what I understand, there is some extra work in writing a PYD module, in contrast to writing a DLL that is called with ctypes. I have not looked into this in great detail yet, but ultimately, I would like to get some DLLs written in the correct form so they can be used as PYDs. I guess there are some basic rules for Python to 'talk' with its package modules. Anyhow, your plan sounds good, so if there's any way I can help just let me know. Adam On 15/08/2008, René Dudfield [EMAIL PROTECTED] wrote: What is the best way to compile extensions for python CE ? Adam: do you have a link to those SCUMVM files? Any further progress? Why not pygame-ctypes? It was slow, buggy, and non-portable - and C pygame worked fine. The author was paid to do it, and stopped when the money ran out and moved on to pyglet. pygame has a bunch of C code which just can't run fast enough in python. Pygame is not just a SDL wrapper, it's got a bunch of other code in it too. ctypes has an overhead for each call which is annoying for real time apps. However... pygame-ctypes is still useful for some things, and if pypy ever gets fast it will become more important (assuming they never release a C api for pypy). anyway... I'd going to try the following order of things... - get a simple C program to compile and run on the device. - get a simple C python extension module working. - get a simple SDL program working. - get some pygame modules running. - get full pygame test suite working. - port pygame example programs so they work ok on pythonCE too. On Thu, Aug 7, 2008 at 6:47 PM, Adam Walley [EMAIL PROTECTED] wrote: My plans, exactly ;-) BTW why was pygame-ctypes abandoned? Reading some of the past info on it, it seemed like a great idea to use the ctypes module. 2008/8/7 René Dudfield [EMAIL PROTECTED] nice work :) It can be easier to first try and get the SDL test programs compiling. Then try and get a really simple, minimal python extension compiling... and you guessed it, try and get them both compiling together :) There's a few wince folks hanging out on the libsdl mailing list if you have troubles there. cu, On Wed, Aug 6, 2008 at 9:02 PM, Adam Walley [EMAIL PROTECTED] wrote: Well, I have been attempting to get something working, but have been struggling to get the SDL compiled correctly (without SDL, there is no point in trying to get pygame working). In my investigations, I came across the SCUMM forum. Now the SCUMMVM appears to be a fully working product on various platforms including WinCE. My attempts to compile some simple test programs using the SDL source available from the official SDL site failed (mostly because the source will not compile 'as is' and needs some tweaking which is probably beyond my capabilities). However, the SCUMM forum pointed me to a set of libraries from 'knakos'. I quickly set up a new project, with my simple test program, and lo! it compiled first time and tested correctly on my WM5 device. I assume these SCUMM libraries have already been adapted to work on WinCE, and since the SCUMM idea is to get retro graphical games working, I think that pygame will probably get all the functionality it needs from them. Now, on to getting pygame working! I will attempt to get some of the pygame source modules compiled as PYDs to see if they will import and work under PythonCE. I have not yet attempted to get a DLL compiled using these new libraries so may yet hit a wall. I will report back with any news. Rene, thanks for your comments. It's nice to know there is interest from the pygame side. If anyone else would like to provide comments/advice/code to get pygame working, it will be welcomed. Adam
Re: [PythonCE] DLL hourglass in ctypes
Well, my initial question certainly seems to have stirred some interest. Thanks to everyone for the input. I think what I can draw from all this is that: 1. The hourglass/busy icon is useful to give users an indication of when the application is busy 'grinding' away at something and user input is not expected/possible at that time - as in the application John described in a previous post. 2. The hourglass/busy icon is NOT helpful when the application is doing some processing that involves some visual effects, since the hourglass/busy icon then interferes and obscures the display. This is a nuisance, when the application is trying to display something on screen (whether it requires user input or not). I would say most pygame applications fall into this category (and the idea of pygame for PythonCE is what prompted this post in the first place). My conclusion would be that while there is no harm in having this icon appear by default, it cannot be left to the system to decide when the icon should appear. Therefore, a method of 'disabling' the icon, at least for the duration of the execution of a script, would be useful. Jared kindly pointed out that the ppygui package already has this covered, so at least in the first instance I will see whether I can combine what I have built so far with ppygui to see if I can achieve a satisfactory result. Thanks again to all. Adam 2008/8/13 Brad Clements [EMAIL PROTECTED] Christopher Fairbairn wrote: They use code along the lines of: import _pcceshell_support _pcceshell_support.Busy(0); I haven't liked this, since it means each library needs to be aware of something PythonCE specific. For cleaness I think the native C part of the Python interpreter can (and should) take care of this. Ah, this rings a bell. I think according to the Windows CE compatibility guide, you're supposed to show the hourglass until your application is ready for user input. I believe it's up to the application .py file, not any libraries or interpreter, to make the Busy(0) call. Only the application author knows how many modules need to be loaded and when the application really has started. -- Brad Clements,[EMAIL PROTECTED](315)268-1000 http://www.murkworks.com AOL-IM: BKClements ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
My plans, exactly ;-) BTW why was pygame-ctypes abandoned? Reading some of the past info on it, it seemed like a great idea to use the ctypes module. 2008/8/7 René Dudfield [EMAIL PROTECTED] nice work :) It can be easier to first try and get the SDL test programs compiling. Then try and get a really simple, minimal python extension compiling... and you guessed it, try and get them both compiling together :) There's a few wince folks hanging out on the libsdl mailing list if you have troubles there. cu, On Wed, Aug 6, 2008 at 9:02 PM, Adam Walley [EMAIL PROTECTED] wrote: Well, I have been attempting to get something working, but have been struggling to get the SDL compiled correctly (without SDL, there is no point in trying to get pygame working). In my investigations, I came across the SCUMM forum. Now the SCUMMVM appears to be a fully working product on various platforms including WinCE. My attempts to compile some simple test programs using the SDL source available from the official SDL site failed (mostly because the source will not compile 'as is' and needs some tweaking which is probably beyond my capabilities). However, the SCUMM forum pointed me to a set of libraries from 'knakos'. I quickly set up a new project, with my simple test program, and lo! it compiled first time and tested correctly on my WM5 device. I assume these SCUMM libraries have already been adapted to work on WinCE, and since the SCUMM idea is to get retro graphical games working, I think that pygame will probably get all the functionality it needs from them. Now, on to getting pygame working! I will attempt to get some of the pygame source modules compiled as PYDs to see if they will import and work under PythonCE. I have not yet attempted to get a DLL compiled using these new libraries so may yet hit a wall. I will report back with any news. Rene, thanks for your comments. It's nice to know there is interest from the pygame side. If anyone else would like to provide comments/advice/code to get pygame working, it will be welcomed. Adam. On 06/08/2008, René Dudfield [EMAIL PROTECTED] wrote: Hi, if anyone has any project files to build pygame on pythonce I'd love to have them included with pygame. I'm an author/maintainer of pygame and have commit access to svn, so could add project files if someone makes them... I could also add a pygame download for python CE to the pygame.org download page. Or you could add compilation instructions to the pygame wiki here: http://pygame.org/wiki/CompilePythonCE I have a winCE phone so would love to be able to get pygame running on it :) cheers, ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
Well, I have been attempting to get something working, but have been struggling to get the SDL compiled correctly (without SDL, there is no point in trying to get pygame working). In my investigations, I came across the SCUMM forum. Now the SCUMMVM appears to be a fully working product on various platforms including WinCE. My attempts to compile some simple test programs using the SDL source available from the official SDL site failed (mostly because the source will not compile 'as is' and needs some tweaking which is probably beyond my capabilities). However, the SCUMM forum pointed me to a set of libraries from 'knakos'. I quickly set up a new project, with my simple test program, and lo! it compiled first time and tested correctly on my WM5 device. I assume these SCUMM libraries have already been adapted to work on WinCE, and since the SCUMM idea is to get retro graphical games working, I think that pygame will probably get all the functionality it needs from them. Now, on to getting pygame working! I will attempt to get some of the pygame source modules compiled as PYDs to see if they will import and work under PythonCE. I have not yet attempted to get a DLL compiled using these new libraries so may yet hit a wall. I will report back with any news. Rene, thanks for your comments. It's nice to know there is interest from the pygame side. If anyone else would like to provide comments/advice/code to get pygame working, it will be welcomed. Adam. On 06/08/2008, René Dudfield [EMAIL PROTECTED] wrote: Hi, if anyone has any project files to build pygame on pythonce I'd love to have them included with pygame. I'm an author/maintainer of pygame and have commit access to svn, so could add project files if someone makes them... I could also add a pygame download for python CE to the pygame.org download page. Or you could add compilation instructions to the pygame wiki here: http://pygame.org/wiki/CompilePythonCE I have a winCE phone so would love to be able to get pygame running on it :) cheers, ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
[PythonCE] cegcc on Debian etch amd64
Hello, all. I have not posted to the cegcc list before, but have been working on some pythonCE projects, where cegcc might prove a useful tool (I hope). I realise that the following is not really a pythonCE topic, but thought it might be useful to some of the list's readers given some of the recent discussions. This post was really just to confirm that cegcc can be compiled from source (from the cegcc SF download page). I thought I should mention this, because I did not see any amd64 packages for cegcc, and there were very few posts relating to using cegcc with an amd64 processor or with debian (perhaps it has gone so smoothly for everyone that no questions were asked?). The steps I followed were: - download the source package (platform independent) - extract to a convenient folder - I used 'su' privileges (though sudo might be ok too) - run the 'build-cegcc.sh' script located in the cegcc/src folder - if errors occur, just go through the output carefully to locate any packages, which may not be present on your machine (I had to install 'bison' and 'flex' using the usual 'apt-get install' command) - IMPORTANT! before running the build script again, remove the 'build' folder that was created in the 'src' folder during the initial failed build attempt. If you do not do this the build script will almost certainly fail again. - it can take some time to build the entire package - I think there were some minor warnings/errors, but the cegcc structure and files all appeared correctly - check that the files are there in /opt/cegcc - if you want to be able to call the compilers from a Gnome terminal window you need to add this folder to the $PATH variable. To do this, simply edit the /etc/profile file (use 'su' or 'sudo' to do this) and add the following line at the end of the file: export PATH=$PATH:/opt/cegcc/bin The change will only take effect the next time you open a terminal window - Now you can access the cegcc compilers from any folder. Type 'arm-wince-cegcc-gcc' to check that it works. The reply should be 'no input files' - Now I simply followed the 'getting started' steps at http://cegcc.sourceforge.net/docs/using.html - remembering to copy across the relevant DLL files to my PDA (cegcc.dll, cegccthrd.dll, and libstdc++.dll) - these DLLs will work if you put them in the same directory as the EXE you want to run, but a more sensible place for them is the main Windows directory. These DLLs add up to about 1MB, so you don't want to be duplicating them too much. That's it. I can confirm that the 'hello' dialog appears on my WM5 pda. hth (especially, like me if you are still just a beginner, or you are looking to get started quickly). Adam ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
Christopher and Jared, Thank you for your comments. Christopher would you agree about the sluggishness once pygame is running on a PDA? I suppose I am not too bothered at the moment. For my purposes just being able to access audio and drawing to screen would be fine - though I'm sure sooner or later speed will be needed too. One additional obstacle I face is some extra fiddling to get the compiling done on PellesC (I do not own VS and I believe the free version does not support WinCE compilation). Anyhow, I will attempt to get something working, and if it gives respectable results I will report back. Thanks again for your input. Adam On 26/07/2008, Christopher Fairbairn [EMAIL PROTECTED] wrote: Hi, On Sat 26/07/08 05:13 , Adam Walley [EMAIL PROTECTED] sent: - is there already a way to get distutils working with PythonCE? There has been recent discussions about this, but at current I don't bieleve there is anything available. With respect to SDL and pygame it should be fairly easy to get the various python modules compiled. There have been a couple of releases built for PythonCE in the past and I've personally compiled from source a couple of times. The SDL project has an additional ZIP file that contains Windows CE (Pocket PC) compatible project files that will allow you to build a suitable dll. If you look at the distutils based installation files for the pygame distribution you can determine which source files need to be compiled into the various python modules (*.pyd). What I did was then manually create project files for Visual Studio to build these DLLs (you will need a source release of PythonCE itself for this, as to build a module you will require the python header files). Once I had all the pygame dlls compiled it was then simply a matter of copying them to the correct folder on the PDA. There was no registry settings etc involved. One thing to keep in mind is that some of the sample apps within the Pygame distribution won't work on a PDA without minor modifications. For example they commonly request a window size which is larger than the PDA's screen, and don't account for the lack of current working directory support when specifying file names for bitmap resources etc. Hope this helps, Christopher Fairbairn ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] PPYGUI - parent window and closing it
That's perfect! Thanks for your suggestions. I have adjusted the registry to allow for .pyw files without the shell (CeRegEditor did the job). Now when I run my code and press the 'X' in the top right corner, the whole thing exits smoothly and fully - Great! I didn't want to use tMan because that would mean that my users would need to use/install it too. Binding the close signal to the app works very nicely with the emulator without tMan, but not on my WM5 device (as you had explained). Thanks again for the assistance. Adam. 2008/7/10 Alexandre Delattre [EMAIL PROTECTED]: Hello, Alexandre. I have begun testing some ideas using the PPYGUI and find it very easy to work with. However, I would like to ask if there is a way to know when the user has pressed the 'X' button in the top right of the window to close the app? The reason I ask, is that when I run some ppygui code a blank Python window opens, then the ppygui app window opens on top of it. When I close the app using the top right 'X' I am returned to the blank Python window. This is very similar to the situation on the desktop version of Python, where a terminal window opens unless your Python file is run with the .pyw extension. I can implement a 'close' button that executes the sys.exit() command, and this successfully closes the app and the blank Python terminal window together. Nevertheless that top right 'X' is still there, and I would prefer the users of my app to have something consistent and which behaves as expected (i.e when you press 'X' the app exits or at least is hidden fully). How do it detect this 'close' event for the main app? Adam Currently the best option is to install the tMan task manager http://pda.jasnapaka.com/tman/ or others, which allow to close program when clicking 'X' instead of the default minimize behaviour which is problematic with PythonCE (other PythonCE gui toolkits have the same problem regarding this). PPygui has already some inner logic, which makes the 'app.run()' line returns when the main frame is closed (with tMan), so it'll work well with it. Unfortunately the .pyw extension is buggy on PythonCE due to a mis-written registry key, You can fix it with a registry editor of your choice, by setting the key: HKEY_CLASSES_ROOT/Python.File.NoShell/Shell/Open/Command/Default = \Program Files\Python25\python.exe /nopcceshell %1 You can also intercept the 'close' event at application level (but still need tMan to work) import ppygui as gui class MainFrame(gui.CeFrame): def __init__(self): gui.CeFrame.__init__(self, title='Hello') self.bind(close=self.on_close) def on_close(self, ev): if gui.Message.yesno('Confirmation','Do you want to quit','question', self) == 'yes': ev.skip() # If user say yes, let the close event be further processed by the default implementation which will close the window for good Hope this helps, Alexandre ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] PPYGUI - parent window and closing it
Alexandre, Thank you for this news. I will update things tomorrow and see if it works. Just to be clear, when I originally tested my app, the Python shell launches and the ppygui app opens on top of it. I was able to go into settings/system/memory and close the Python shell without affecting the normal operation of the ppygui. Also, when I exited my ppygui app using my sys.exit() button everything closes correctly and is no longer resident - I checked this in settings/system/memory. When I used the 'X' then both the shell and the app would remain resident until I terminated them manually. This also prevented me from running another app until I had done this. Using the registry tweak, the Python shell is not visible and it does not even appear in the list under settings/system/memory; only my app's name appears. When I exit, everything is closed normally whether I use my own sys.exit() button or the 'X' in the corner, and nothing remains in memory (unless it somehow stays there without appearing in the system's list). These are my experiences specific to my iPAQ1950 running WM5 and PythonCE 2.5, so other systems may not behave exactly this way (though PythonCE does seem to be quite consistent). Anyhow, I think this problem has been resolved, so thanks again. Adam On 10/07/2008, Alexandre Delattre [EMAIL PROTECTED] wrote: Adam, there's one downside to not use tMan: even if the window disappear it is still running background and the only way to really close it is in the Memory app of the control panel. But rejoice, following this discussion I've been able to modify ppygui so that windows are really closed even without tMan :) Now, even a .py file will see it's terminal closed when the gui main frame is closed, without using tMan. Expect to see the code in svn in a few hours. Alexandre ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
[PythonCE] serial input problem
From: Adam Walley [EMAIL PROTECTED] Date: 31 Mar 2008 13:15 Subject: Re: [PythonCE] serial input problem To: Jan Ischebeck [EMAIL PROTECTED] Hi, Jan. Thanks for the reply. I am using 19200 baud, but I have also checked 2400, 4800, 9600, 14400, 38400, 57600 - same result. The other settings are 8N1 (set as 8,0,1 in the ceserial module). I have checked my modem settings to see that there is nothing which could interfere, but AFAIK all seems ok. I have made sure my wiring is ok too. All these checks are good, but the fact is that my terminal program works correctly, and PythonCE continues to give me these scrambled answers. The first character usually seems to be correct, but after that it seems to be garbage. The OK reply from my modem comes in as: 13 A1 6A 35 (in hex). If I switch to numeric modem responses the modem replies with 0 instead of OK. In this case, PythonCE gives me a 0 followed by a square (indicating a character which cannot be displayed). I feel like I am missing something simple, but just cannot put my finger on it. Just a note on encoding, my 'sys.getdefaultencoding()' is 'ascii' and my ' sys.getfilesystemencoding()' is 'mbcs'. I hope you can help. Adam On 30/03/2008, Jan Ischebeck [EMAIL PROTECTED] wrote: Hi Adam, Have you checked Baudrate, Stopbit and Parity Settings? The begin of the modems answer in hex makes sense ( 0x0D = 13 = carriage return). The last byte is 0x0A = 10 = line feed. But A1 6A 35 is neither raw unicode, utf-8 or utf-16 so I guess something is wrong with the line settings. Jan Adam Walley wrote: PPC: AT Modem: íj5 (this should be '0') The full modem response in hex is: 0D A1 6A 35 0A ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce