From angelpeream at gmail.com Thu Sep 1 23:31:47 2005 From: angelpeream at gmail.com (Angel Perea) Date: Thu, 1 Sep 2005 23:31:47 +0200 Subject: [PythonCE] serial port Message-ID: <7d0220060509011431781fbd3d@mail.gmail.com> Does anybody know if now it's possible to access the serial port using python? I've searched the web a couple of times with no success at all. Anybody working on it? rtfm? On the other side, after getting tired of waiting PIL to be ported (imprabable, anyway :-) , just coded a 100% python minimalist library to create .png files and draw on them (so far lines, circles and polygons). I use it to display objects in the explorer, using a server. I'll post them as soon as possible (as soon as I get them documented and presentable) I think this is an alternative solution to widgets. If anybody is interested in the graphic library or the console for the explorer, please make me know. Thanks From mike at pcblokes.com Fri Sep 2 09:53:12 2005 From: mike at pcblokes.com (Michael Foord) Date: Fri, 02 Sep 2005 08:53:12 +0100 Subject: [PythonCE] serial port In-Reply-To: <7d0220060509011431781fbd3d@mail.gmail.com> References: <7d0220060509011431781fbd3d@mail.gmail.com> Message-ID: <431804E8.4090202@pcblokes.com> Angel Perea wrote: > Does anybody know if now it's possible to access the serial port using > python? I've searched the web a couple of times with no success at > all. > I've never seen anything like this for PythonCE. There is PySerial for the desktop - but communicating with PDA hardware would be very different (I suspect). > Anybody working on it? rtfm? > > On the other side, after getting tired of waiting PIL to be ported > (imprabable, anyway :-) , just coded a 100% python minimalist library > to create .png files and draw on them (so far lines, circles and > polygons). I use it to display objects in the explorer, using a > server. > > I'll post them as soon as possible (as soon as I get them documented > and presentable) > > I think this is an alternative solution to widgets. > > If anybody is interested in the graphic library or the console for the > explorer, please make me know. > Yes - interested :-) Fuzzyman http://www.voidspace.org.uk/python > Thanks > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > > From mike at pcblokes.com Fri Sep 2 11:19:02 2005 From: mike at pcblokes.com (Michael Foord) Date: Fri, 02 Sep 2005 10:19:02 +0100 Subject: [PythonCE] COmpiling Python 1.5.2 Message-ID: <43181906.7000905@pcblokes.com> Hello All, I'm still trying to get a working version of Python for my Jornada device running Windows 2.11. It has a StrongARM processor - which is unusual for a device running 2.11. There is a version of Python 1.5.2 for WindowsCE 2.11. (Created by Mark Hammond). Unfortunately the installer only has compiled binaries for SH and MIPS processors. All the source code is still available from the Hammond site : http://starship.python.net/crew/mhammond/ce/old.html Does anyone have the ability to compile the source code for the Python 1.5.2 project into binaries for the StrongARM processor ? It would be much appreciated - I need the ability to convert between Linux and Windows line endings... (and other such tasks that Python has always been great at). Many Hopeful Thanks In Advance....... Fuzzyman http://www.voidspace.org.uk/python From kzielinski at gmail.com Fri Sep 16 07:58:28 2005 From: kzielinski at gmail.com (konrad Zielinski) Date: Fri, 16 Sep 2005 15:58:28 +1000 Subject: [PythonCE] Getting Started with Python on Mobile windows 2003 Message-ID: <7fa65f9c050915225821883532@mail.gmail.com> Hi, I'm trying to get started with Python on Pocket PC and have several questions 1) is there a python bindign for Game API 2) is it possible to directly execute Scripts by clicking on them? 3) What would a basic GUI hello world application look like (I mean one which opens full screen) Regards Konrad From EdwardFewell at hotmail.com Fri Sep 16 15:38:45 2005 From: EdwardFewell at hotmail.com (Edward Fewell) Date: Fri, 16 Sep 2005 08:38:45 -0500 Subject: [PythonCE] Getting Started with Python on Mobile windows 2003 In-Reply-To: Message-ID: 1) I don't know. I've done some brief looking about and haven't found anything of the sort yet. 2) Yes. I've installed the 2.3.4 port onto my Mobile 2003 device. It included a script to update the registry so that you can just click on scripts to execute them. 3) Below is a Tkinter demo modified to work on my device. I have installed the 2.3.4 PythonCE and the tcl 8.4.3 ports on my device. A bit more than a simple Hello World demo, but it's pretty straight forward and fills the screen with a variety of the widgets available. Some comments. The demo was taken from a desktop Tkinter example and trimmed to fit my device. It needs a sample text file: \My Documents\Personal\sample.txt. Any ol' text file should do. The tcl libraries are not in the default sys.path. I've hacked in a little fix for that into the demo, but I suspect there's a more permanent system wide fix possible. I've just started using Python myself here. The check boxes and radio buttons appearance is wrong on my device. They seem to behave properly but the check boxes are round buttons, and the radio buttons are square boxes. The Tkinter calls create a window with a title bar and a menu at the top rather than a more PPC-like window. Errors in scripts cause a Python Error window to open full screen with some rather unhelpful information. Closing this window completely closes Python. If you go to your task manager, you'll find a Python CE window which you can activate. That window has the full error information you need to figure out what went wrong. So switch to that window, don't close the error window. This particular port of Python is missing hooks to create a process or execute system calls. Those are necessary for a lot of typical scripting tasks, and I was rather disappointed that at the least CreateProcess() wasn't there. Quite of bit of the Windows API was done, just not CreateProcess(). ---------------------------------------------------------------------------- import sys import os sample = "sample.txt" if os.name == 'ce': global sample import sys sys.path.insert(0, "\\Program Files\\Python\\lib\\python23.zip\\lib-tk") sample = "\\My Documents\\Personal\\sample.txt" from Tkinter import * class AllTkinterWidgets: def __init__(self, master): frame = Frame(master, width=240, height=320, bd=1) frame.pack() self.mbar = Frame(frame, relief = 'raised', bd=2) self.mbar.pack(fill = X) # Create File menu self.filebutton = Menubutton(self.mbar, text = 'File') self.filebutton.pack(side = LEFT) self.filemenu = Menu(self.filebutton, tearoff=0) self.filebutton['menu'] = self.filemenu # Populate File menu self.filemenu.add('command', label = 'Exit', command = self.quit) # Create edit menu self.editbutton = Menubutton(self.mbar, text = 'Edit') self.editbutton.pack(side = LEFT) self.editmenu = Menu(self.editbutton, tearoff=0) self.editbutton['menu'] = self.editmenu # Populate edit menu self.editmenu.add('command', label = 'edit', command = self.stub) # Create view menu self.viewbutton = Menubutton(self.mbar, text = 'View') self.viewbutton.pack(side = LEFT) self.viewmenu = Menu(self.viewbutton, tearoff=0) self.viewbutton['menu'] = self.viewmenu # Populate view menu self.viewmenu.add('command', label = 'view', command = self.stub) # Create help menu self.helpbutton = Menubutton(self.mbar, text = 'Help') self.helpbutton.pack(side = RIGHT) self.helpmenu = Menu(self.helpbutton, tearoff=0) self.helpbutton['menu'] = self.helpmenu # Populate help menu self.helpmenu.add('command', label = 'help', command = self.stub) iframe1 = Frame(frame, bd=2, relief=SUNKEN) Button(iframe1, text='Click').pack(side=LEFT, padx=5) Checkbutton(iframe1, text='Check').pack(side=LEFT, padx=5) v=IntVar() Radiobutton(iframe1, text='dio', variable=v, value=2).pack(side=RIGHT, anchor=W) Radiobutton(iframe1, text='Ra', variable=v, value=1).pack(side=RIGHT, anchor=W) iframe1.pack(expand=1, fill=X, pady=10, padx=5) iframe2 = Frame(frame, bd=2, relief=RIDGE) Label(iframe2, text='Label:').pack(side=LEFT, padx=5) t = StringVar() Entry(iframe2, textvariable=t, font=("arial", 8, "normal"), bg='white').pack(side=RIGHT, padx=0) t.set('Entry') iframe2.pack(expand=1, fill=X, pady=5, padx=5) iframe3 = Frame(frame, bd=2, relief=SUNKEN) text=Text(iframe3, height=5, width =30, font=("arial", 8, "normal")) fd = open(sample) lines = fd.read() fd.close() text.insert(END, lines) text.pack(side=LEFT, fill=X, padx=5) sb = Scrollbar(iframe3, orient=VERTICAL, command=text.yview) sb.pack(side=RIGHT, fill=Y) text.configure(yscrollcommand=sb.set) iframe3.pack(expand=1, fill=X, pady=10, padx=5) iframen = Frame(frame, bd=2, relief=FLAT) Message(iframen, text='This is a Message widget', width=240, relief=SUNKEN).pack(fill=X, padx=5) iframen.pack(expand=1, fill=X, pady=5, padx=5) def quit(self): root.destroy() def stub(self): pass root = Tk() root.option_add('*font', ('arial', 8, 'bold')) all = AllTkinterWidgets(root) root.title('Tkinter Widgets') root.mainloop() From isrgish at fastem.com Fri Sep 16 18:15:53 2005 From: isrgish at fastem.com (Isr Gish) Date: Fri, 16 Sep 2005 12:15:53 -0400 Subject: [PythonCE] Getting Started with Python on Mobile windows 2003 Message-ID: <20050916161643.9F0C61E4008@bag.python.org> konrad Zielinski wrote: >Hi, > >I'm trying to get started with Python on Pocket PC >and have several questions > >2) is it possible to directly execute Scripts by clicking on them? This is possible to set up. There is a script in the download that does the registry settings for you. >Regards > >Konrad >_______________________________________________ >PythonCE mailing list >PythonCE at python.org >http://mail.python.org/mailman/listinfo/pythonce > From a.g.booth at leeds.ac.uk Sun Sep 18 16:48:39 2005 From: a.g.booth at leeds.ac.uk (Andrew Booth) Date: Sun, 18 Sep 2005 15:48:39 +0100 Subject: [PythonCE] Tkinter radiobutton problem Message-ID: <000001c5bc60$0e82e9b0$6400a8c0@booth1> I'm writing a simulation program using PythonCE and Tkinter. One of my dialogs has a group of radiobuttons. On my Linux box, these are rendered correctly, but on PythonCE they display as checkboxes. They behave like radiobuttons - when one is activated, the others are de-activated, but they look like checkboxes. The program works OK, but it looks a bit unprofessional. Has anyone had a similar problem and does anyone know how to get the radiobuttons to be rendered correctly? I'm using an iPAQ 5550 with Windows Mobile 2003. Andrew Booth From kzielinski at gmail.com Mon Sep 19 01:28:16 2005 From: kzielinski at gmail.com (konrad Zielinski) Date: Mon, 19 Sep 2005 09:28:16 +1000 Subject: [PythonCE] Getting Started with Python on Mobile windows 2003 In-Reply-To: References: Message-ID: <7fa65f9c05091816283c01a348@mail.gmail.com> 1) I only have 2.2 installed at the moment. somehow I found the installation instructions much easier to follow. 2) There is a win32gui module, which exposes the Mobile windows API. I'd be more incined to use this directly for GUI applications. This is what I'd like to see an example of. I suspect it will not suffer from isses of things looking wrong. On 9/16/05, Edward Fewell wrote: > 1) I don't know. I've done some brief looking about and haven't found > anything of the sort yet. > > 2) Yes. I've installed the 2.3.4 port onto my Mobile 2003 device. It > included a script to update the registry so that you can just click on > scripts to execute them. > > 3) Below is a Tkinter demo modified to work on my device. I have installed > the 2.3.4 PythonCE and the tcl 8.4.3 ports on my device. A bit more than a > simple Hello World demo, but it's pretty straight forward and fills the > screen with a variety of the widgets available. > << snip >> From wesbrooks at gmail.com Mon Sep 19 17:24:18 2005 From: wesbrooks at gmail.com (Wesley Brooks) Date: Mon, 19 Sep 2005 16:24:18 +0100 Subject: [PythonCE] Installing Python, wxWindows, and VTK Message-ID: Dear Users, I intend to be able to modify and test small parts of my code using my PDA. Has anyone installed wxWindows/VTK on a PDA and can you offer any advice? I was hoping to find a package similar to what I use on my computer - supplied by enthought.com - where all I do is download then run a installer and all the libraries are ready to use. Does this exist? Thank you for your time and help. Yours Faithfully, Wesley Brooks From EdwardFewell at hotmail.com Mon Sep 19 20:58:58 2005 From: EdwardFewell at hotmail.com (Edward Fewell) Date: Mon, 19 Sep 2005 13:58:58 -0500 Subject: [PythonCE] Getting Started with Python on Mobile windows 2003 In-Reply-To: Message-ID: << There is a win32gui module, which exposes the Mobile windows API. >> There should also be a win32api module and win32con module. I don't have those in my installation, and haven't had luck finding them. win32con is just a collection of constants, so the desktop version would be very, very close with a few tweaks. And we can skip using win32api for a simple demo. There's a bigger problem in that win32gui isn't working (or at least the version I have). And it's also incomplete (even the desktop version is missing some of the APIs). Below is a sample that should create a window. You can run it on a desktop, and it correctly creates the window. The print messages show up in the console window confirming that the message pump is hooked in and getting the WM_PAINT messages. Sadly, that's where I wanted to put code to put text on the window, but DrawText() isn't implemented in win32gui. Also the WM_DESTROY message happens, I manually issue a quit message, the gui window closes, but the console window stays open. We never return from the message pump. Under CE, I see all those problems plus an issue that CE never paints the window background. Also it leaves the hourglass cursor up. I do get a window, and can drag it around by the title bar. I can even see that it is getting Windows messages. But it's just not getting redrawn, so it's not very useful yet. ------------------------------------------------------------------------ import struct #import win32api #import win32con import win32gui import os # Defines taken from desktop win32con.py class win32con: CS_VREDRAW = 1 CS_HREDRAW = 2 IDC_ARROW = 32512 COLOR_WINDOW = 5 IDI_APPLICATION = 32512 DLGWINDOWEXTRA = 32 WS_OVERLAPPED = 0 WS_VISIBLE = 268435456 WS_CAPTION = 12582912 WS_SYSMENU = 524288 WS_THICKFRAME = 262144 WS_MINIMIZEBOX = 131072 WS_MAXIMIZEBOX = 65536 WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED | \ WS_CAPTION | \ WS_SYSMENU | \ WS_THICKFRAME | \ WS_MINIMIZEBOX | \ WS_MAXIMIZEBOX) CW_USEDEFAULT = -2147483648 GWL_WNDPROC = -4 SW_SHOW = 5 WM_PAINT = 0x000F WM_DESTROY = 0x0002 MB_OK = 0x0000 class MainWindow: def __init__(self): # Customize for WinCE if os.name == "ce": print "Running under CE" className = unicode("win32gui test") # not coverted to unicode by win32gui style = win32con.WS_VISIBLE # WS_OVERLAPPEDWINDOW isn't valid style for CE hIcon = 0 # LoadIcon on IDI_APPLICATION isn't working else: print "Running on desktop" className = "win32gui test" style = win32con.WS_OVERLAPPEDWINDOW hIcon = win32gui.LoadIcon(0, win32con.IDI_APPLICATION) # Initialize instance win32gui.InitCommonControls() self.hinst = 0 # win32api.GetModuleHandle(None) # Register class wc = win32gui.WNDCLASS() wc.style = win32con.CS_HREDRAW | win32con.CS_VREDRAW wc.lpfnWndProc = self.MyWndProc wc.hCursor = win32gui.LoadCursor( 0, win32con.IDC_ARROW ) wc.hbrBackground = win32con.COLOR_WINDOW + 1 wc.hIcon = hIcon wc.lpszClassName = className wc.cbWndExtra = 0 classAtom = win32gui.RegisterClass(wc) # Create window style = win32con.WS_OVERLAPPEDWINDOW | win32con.WS_VISIBLE self.hwnd = win32gui.CreateWindow(className, "win32gui Sample", style, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, 0, 0, self.hinst, None) # Hook WndProc self.oldWndProc = win32gui.SetWindowLong (self.hwnd, win32con.GWL_WNDPROC, self.MyWndProc) win32gui.ShowWindow(self.hwnd, win32con.SW_SHOW) win32gui.UpdateWindow(self.hwnd) def MyWndProc(self, hwnd, message, wparam, lparam): if message == win32con.WM_PAINT: return self.OnPaint(hwnd, message, wparam, lparam) if message == win32con.WM_DESTROY: return self.OnDestroy(hwnd, message, wparam, lparam) return win32gui.CallWindowProc(self.oldWndProc, hwnd, message, wparam, lparam) def OnPaint(self, hwnd, message, wparam, lparam): print "on paint" return win32gui.CallWindowProc(self.oldWndProc, hwnd, message, wparam, lparam) def OnDestroy(self, hwnd, message, wparam, lparam): print "on destroy" win32gui.PostQuitMessage(0) return True print "Starting up ..." win32gui.MessageBox(0, "Hello world!", "win32gui Sample", win32con.MB_OK) w = MainWindow() win32gui.PumpMessages() print "Quit?" From EdwardFewell at hotmail.com Mon Sep 19 21:05:54 2005 From: EdwardFewell at hotmail.com (Edward Fewell) Date: Mon, 19 Sep 2005 14:05:54 -0500 Subject: [PythonCE] Tkinter radiobutton problem In-Reply-To: Message-ID: I've sent the same problem using Tkinter on my phone. I don't know of a fix for the real problem, but you might be able to work around the issue. Can you respond to check events on the check boxes? If so, then use check boxes for your radio buttons and programmatically simulate radio button behavior. Likewise, you might be able to use radio buttons in groups of ones to have the appearance and functionality of check boxes. That may not work, or may not be worth the trouble. From bjg at network-theory.co.uk Mon Sep 26 21:50:16 2005 From: bjg at network-theory.co.uk (Brian Gough) Date: Mon, 26 Sep 2005 20:50:16 +0100 Subject: [PythonCE] PhotoImage color distortion Message-ID: <17208.20728.503210.405707@network-theory.co.uk> Hello, I'm porting a Python/Tkinter app to an IPAQ and have hit a strange problem with Photoimage colors. The app works, but the colors in all the PhotoImage's are "off" slightly making it look ugly. For example, white in a GIF or PPM is displayed in a PhotoImage as a light blue-grey, and doesn't match up with the white background of the app set with bg="white". Opening up the gifs in IE on the IPAQ gives the correct colors, so somehow Tk is not displaying them correctly. I'm using Python/Tkinter from http://fore.validus.com/~kashtan/ and the IPAQ is a 65k color model. It all works fine on the standard desktop Windows Python/Tkinter. Anyone seen this or have any ideas how I can fix it? Thanks. -- Brian Gough Network Theory Ltd, Publishing Free Software Manuals --- http://www.network-theory.co.uk/ From a.g.booth at leeds.ac.uk Tue Sep 27 12:58:25 2005 From: a.g.booth at leeds.ac.uk (Andrew Booth) Date: Tue, 27 Sep 2005 11:58:25 +0100 Subject: [PythonCE] Tkinter radiobutton problem Message-ID: <2964075E1E6B204C8DDEA2A5B2B10F630131EB2C@VEX2.ds.leeds.ac.uk> Thanks. In the end I set indicatoron=False. This gave buttons instead of radiobuttons. It seems to work OK and the buttons are easier to hit with the stylus. ____________________________________________ Andrew G Booth Professor of On-Line Learning and Associate Professor of Biochemistry School of Biochemistry & Microbiology University of Leeds Leeds LS2 9JT U.K. Tel: +44-113-343-3142 Fax: +44-113-343-3167 email: a.g.booth at leeds.ac.uk personal email should be sent to: andrew at agbooth.com ____________________________________________ From bjg at network-theory.co.uk Tue Sep 27 15:19:17 2005 From: bjg at network-theory.co.uk (Brian Gough) Date: Tue, 27 Sep 2005 14:19:17 +0100 Subject: [PythonCE] PhotoImage color distortion In-Reply-To: <17208.20728.503210.405707@network-theory.co.uk> References: <17208.20728.503210.405707@network-theory.co.uk> Message-ID: <17209.18133.284177.113588@network-theory.co.uk> Brian Gough writes: > I'm porting a Python/Tkinter app to an IPAQ and have hit a strange > problem with Photoimage colors. The app works, but the colors in all > the PhotoImage's are "off" slightly making it look ugly. Having played a bit more with different versions of Tcl/Tk on the IPAQ today (http://wiki.tcl.tk/2946), it seems that photoimage display in Tk itself on the PocketPC is just generally broken :-( I tried out various sample images as GIF/PPM/-file/-data and about 50% display corrupted, e.g. diagonally distorted, or truncated with black pixels in the final line, in addition to color problems. -- Brian Gough Network Theory Ltd, Publishing Free Software Manuals --- http://www.network-theory.co.uk/ From chandu at trillian.us Thu Sep 29 22:58:18 2005 From: chandu at trillian.us (Chandu Patil) Date: Thu, 29 Sep 2005 13:58:18 -0700 Subject: [PythonCE] Running setup-registry.py Message-ID: <000001c5c538$865cdb40$8400a8c0@Tracy> I am getting to know pythonce 2.3.4 (#0, July 12 2004, 17:38:34) on a Dell Axim 30 Pocket PC. Just installed and am able to run Python. Next I wanted to run setup-registry. First, is there a list somewhere that has the differences between the Python for say Windows and that for CE? I typed: Import os Os.chdir("\Program Files\Python") // this where the setup-registry file is Execfile("setup-registry.py") After this I get the error _winreg DLL load failed, although it is in the same directory. I know this is elementary and I have looked through the ce posts to find an answer, but was not able to. I am using the remote keyboard utility to exercise the interpreter on the device. The other curious aspect is if you get os.listdir and print that, it only includes the pyd files and none others in the directory. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20050929/fd7d93ce/attachment.htm From stewart.midwinter at gmail.com Fri Sep 30 06:07:24 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Thu, 29 Sep 2005 22:07:24 -0600 Subject: [PythonCE] Running setup-registry.py In-Reply-To: <000001c5c538$865cdb40$8400a8c0@Tracy> References: <000001c5c538$865cdb40$8400a8c0@Tracy> Message-ID: Did you get an answer to your question yet, Chandu? The reason for running setup-registry is so that in future you can just tap on a .py file, and python will launch. S From EdwardFewell at hotmail.com Fri Sep 30 15:52:38 2005 From: EdwardFewell at hotmail.com (Edward Fewell) Date: Fri, 30 Sep 2005 08:52:38 -0500 Subject: [PythonCE] Running setup-registry.py In-Reply-To: Message-ID: When you install PythonCE 2.3.4, it puts a shortcut in the same directory as the setup-registry.py script. Just try clicking on that shortcut from the CE File Explorer. That should be all you need to do to get it installed.