From geir.egeland at gmail.com Tue Jan 4 14:41:55 2005 From: geir.egeland at gmail.com (Geir Egeland) Date: Tue Jan 4 14:41:35 2005 Subject: [PythonCE] wxPython and busy cursor Message-ID: <41DA9D23.5050801@gmail.com> Hi, I'm testing wxPython on my Qtek 9090. The "simple.py" example in the zip file is working fine, but is there any way to get rid of the "busy cursor" in pocket pc? Geir From anne.wangnick at t-online.de Tue Jan 4 16:18:06 2005 From: anne.wangnick at t-online.de (Anne Wangnick) Date: Tue Jan 4 16:18:27 2005 Subject: [PythonCE] Tkinter issues In-Reply-To: <41DA9D23.5050801@gmail.com> Message-ID: Dear all, my application is based on Tkinter, not wxPython, so please excuse when I'm asking a question about good ole Tkinter here ... I was annoyed by the fact that the Tkinter Toplevel windows on the PDA all come sizeable and with that additional titlebar, eating up valuable screen estate. So I had the idea to do the following: import Tkinter import win32gui GWL_EXSTYLE = -20 WS_EX_NODRAG = 0x40000000 tk = Tkinter.Tk() hwnd = tk.winfo_id() wsex = win32gui.GetWindowLong(hwnd,GWL_EXSTYLE) win32gui.SetWindowLong(hwnd,GWL_EXSTYLE,wsex|WS_EX_NODRAG) This "works" on the PC (though the WS_EX_NODRAG is not respected, of course). wsex is returned as 4 (WS_EX_NOPARENTNOTIFY), which is in line with the Tk CreateWindowEx call in tkWinWindow.c:TkpMakeWindow: hwnd = CreateWindowEx(WS_EX_NOPARENTNOTIFY, TK_WIN_CHILD_CLASS_NAME, NULL, style, Tk_X(winPtr), Tk_Y(winPtr), Tk_Width(winPtr), Tk_Height(winPtr), parentWin, NULL, Tk_GetHINSTANCE(), NULL); However, the GetWindowLong and SetWindowLong calls always come back with 0 on the PDA! Alternatively, I tried the same with hwnd = eval(tk.wm_frame()). Same story, GetWindowLong and SetWindowLong return 0. Any idea why this isn't working? I'd love to call GetLastError on the PDA now, but this is in the pywin win32api module, and this is not available on the PDA! Any way win32api could be built for the PDA? I'd give it a try myself, but I don't have a build environment handy. Regards, Sebastian From RPhillips at engineer.co.summit.oh.us Tue Jan 4 20:32:42 2005 From: RPhillips at engineer.co.summit.oh.us (Ron Phillips) Date: Tue Jan 4 20:33:21 2005 Subject: [PythonCE] baseHTTPServer and CGIHTTPServer Message-ID: When I run my little server.py in a subdirectory on Windows XP , it knows where 127.0.0.1:54321/cgi-bin/response.py lives, and the browser receives the appropriate codes from the response.py script. However, when I move the script and server.py to the same file structure on WindowsCE, server.py reports that it can't find response.py. I believe this is simply another aspect of the fact that WindowsCE doesn't recognize local files, and requires that all filenames be fully specified. Is there a way to enter the URL into the browser with the full path? Like: http://127.0.0.1:54321/program files/python/htmlTest/cgi-bin/response.py" ? Or is it some other setting that I need to specify, like some "base File" location that the server then searches down from? Server.py: import BaseHTTPServer import CGIHTTPServer def run(server_class=BaseHTTPServer.HTTPServer, handler_class=CGIHTTPServer.CGIHTTPRequestHandler,): server_address=('',54321) httpd = server_class(server_address,handler_class) httpd.serve_forever() run() from the directory where server.py lives(C:/source) in XP, a file called /cgi-bin/response.py is readily found when I put "http://127.0.0.1/cgi-bin/response.py into the browser when everything's on xp, but not when everything's on CE (/Program Files/python/httpTest/). Server.py says it can't find the file. Ron -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20050104/aa1f8643/attachment.htm From swida at aragorn.pb.bialystok.pl Tue Jan 4 21:53:03 2005 From: swida at aragorn.pb.bialystok.pl (Oskar =?iso-8859-2?Q?=A6wida?=) Date: Tue Jan 4 21:55:18 2005 Subject: [PythonCE] baseHTTPServer and CGIHTTPServer In-Reply-To: References: Message-ID: <32791.81.161.234.129.1104871983.squirrel@81.161.234.129> Hi, I suppose I encountered similar problem. The point is - as always about "current directory" which is not recognized by WinCE. To make this work just change directory explicitly when starting server (before calling run). For example: import os os.chdir("/Program Files/python/httpTest/") Then http://127.0.0.1/cgi-bin/response.py should work. regards, Oskar ?wida > When I run my little server.py in a subdirectory on Windows XP , it > knows where 127.0.0.1:54321/cgi-bin/response.py lives, and the browser > receives the appropriate codes from the response.py script. > > However, when I move the script and server.py to the same file > structure on WindowsCE, server.py reports that it can't find > response.py. I believe this is simply another aspect of the fact that > WindowsCE doesn't recognize local files, and requires that all filenames > be fully specified. Is there a way to enter the URL into the browser > with the full path? Like: http://127.0.0.1:54321/program > files/python/htmlTest/cgi-bin/response.py" ? Or is it some other setting > that I need to specify, like some "base File" location that the server > then searches down from? > > Server.py: > > import BaseHTTPServer > import CGIHTTPServer > > def run(server_class=BaseHTTPServer.HTTPServer, > handler_class=CGIHTTPServer.CGIHTTPRequestHandler,): > server_address=('',54321) > httpd = server_class(server_address,handler_class) > httpd.serve_forever() > run() > > from the directory where server.py lives(C:/source) in XP, a file > called /cgi-bin/response.py is readily found when I put > "http://127.0.0.1/cgi-bin/response.py into the browser when > everything's on xp, but not when everything's on CE (/Program > Files/python/httpTest/). Server.py says it can't find the file. > > Ron > > _______________________________________________ > PythonCE mailing list > PythonCE@python.org > http://mail.python.org/mailman/listinfo/pythonce > From bkc at murkworks.com Tue Jan 4 22:16:33 2005 From: bkc at murkworks.com (Brad Clements) Date: Tue Jan 4 21:58:00 2005 Subject: [PythonCE] baseHTTPServer and CGIHTTPServer In-Reply-To: Message-ID: <41DABCE1.2233.6DA77E61@coal.murkworks.com> On 4 Jan 2005 at 14:32, Ron Phillips wrote: > "http://127.0.0.1/cgi-bin/response.py into the browser when everything's > onxp, but not when everything's on CE (/Program > Files/python/httpTest/).Server.py says it can't find the file. > I'm not familiar with cheap-o cgi serving this way. I suspect that the cgi interface is looking for response.py relative to the current working directory. Windows CE has no concept of cwd, so that cannot work. You'll have to look at the CGIHTTPServer source to be certain. Oh heck, the source says it uses popen or os.fork, well I really don't expect either of those to work on windows CE either. CGI uses self.translate_path which must be defined in SimpleHTTPRequestHandler -- You might consider looking at the dibbler.py module that's included in the spambayes package. Its a really simple way of serving up python code from a python based webserver. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From swida at aragorn.pb.bialystok.pl Tue Jan 4 22:19:12 2005 From: swida at aragorn.pb.bialystok.pl (Oskar =?iso-8859-2?Q?=A6wida?=) Date: Tue Jan 4 22:21:27 2005 Subject: [PythonCE] CGIHttpServer Message-ID: <36237.81.161.234.129.1104873552.squirrel@81.161.234.129> Hi, Some time ago I've written small CGI server variation for PythonCE. I was planning to use WWW as a gui for PythonCE programs. Although idea is very interesting I've found this way ucomfortable, but perhaps someone has another suggestions. Code for this server is included with mail. There is also "ws_stop.py" script (put it into cgi-bin), which is used to stop server. Enjoy. regards, Oskar ?wida -------------- next part -------------- A non-text attachment was scrubbed... Name: WebServ.py Type: application/octet-stream Size: 825 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20050104/5ad2532c/WebServ.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: ws_stop.py Type: application/octet-stream Size: 262 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20050104/5ad2532c/ws_stop.obj From kitsune_e at yahoo.com Wed Jan 5 01:57:49 2005 From: kitsune_e at yahoo.com (Ed Blake) Date: Wed Jan 5 01:57:52 2005 Subject: [PythonCE] Mini IDLE update and response. Message-ID: <20050105005749.90657.qmail@web50202.mail.yahoo.com> I've managed to get popup menus that work. Highlight some text, tap the selection and a menu will appear. It is equivalent to the edit menu/window but seems to work better for cut/copy. I have a problem with this though on my own device (HP Ipaq, WinCE 2003). When I try to highlight text the selection flickers and changes, like the selection is being made over and over. If anyone can figure out what causes this I would be interested in hearing about it. RE the license: I think the example code I based most of this app on was released GPL so unless I can track down the example again and verify its license... I suppose if I verify that the example was other than GPL I should use the python license as that is the license used on IDLE. -------------- next part -------------- A non-text attachment was scrubbed... Name: IdleCE.py Type: text/x-python Size: 13491 bytes Desc: IdleCE.py Url : http://mail.python.org/pipermail/pythonce/attachments/20050104/881c55ad/IdleCE-0001.py From mike at pcblokes.com Wed Jan 5 09:29:49 2005 From: mike at pcblokes.com (Michael Foord) Date: Wed Jan 5 09:29:56 2005 Subject: [PythonCE] Mini IDLE update and response. In-Reply-To: <20050105005749.90657.qmail@web50202.mail.yahoo.com> References: <20050105005749.90657.qmail@web50202.mail.yahoo.com> Message-ID: <41DBA57D.3020704@pcblokes.com> Hello Ed, is great - it's the first useful python app. for windows CE that I've seen - awesome. MANY MANY thanks for your work. It's been such a pain coding with pocket notepad ! I've noticed the problem with selection as well - I guess it's a problem with the WinCE port of Tk. The best you can do is fix the keybindings to the cursor keys, so that selection can be done with the shift-arrow keys. Maybe even implement ctrl-something-or-other to select a block at a time ! Anyway - I have a bit of a wish list for IdleCE. *Mainly* related to key bindings, but not entirely. If you could bear these in mind, I would be personally very grateful. In order of importance : max 1 edit and file menu open at a time key bindings to ctrl-c, ctr-x, ctrl-a, ctrl-v, ctrl-s (copy, cut, select all, paste, save) Also shift- for selection tab for indenting selected area ctrl-[ and ctrl-] for indenting/unindenting selected area tab is four spaces rather than tab (and/or a spaces to tabs/tabs to spaces option) comment in/comment out areas - with key bindings As I said though... I already use IdleCE and am grateful for your work. Do you want this put online somewhere ? Contact me off-list if you do. Regards, Fuzzyman http://www.voidspace.org.uk/python/index.shtml Ed Blake wrote: >I've managed to get popup menus that work. Highlight some text, tap the >selection and a menu will appear. It is equivalent to the edit menu/window >but seems to work better for cut/copy. I have a problem with this though on >my own device (HP Ipaq, WinCE 2003). When I try to highlight text the >selection flickers and changes, like the selection is being made over and >over. If anyone can figure out what causes this I would be interested in >hearing about it. > >RE the license: I think the example code I based most of this app on was >released GPL so unless I can track down the example again and verify its >license... I suppose if I verify that the example was other than GPL I >should use the python license as that is the license used on IDLE. > >------------------------------------------------------------------------ > >#IdleCE > >import sys >sys.path.append('\\Program Files\\Python\\lib\\Python23.zip\\lib-tk') >import sys >import os >import re >from Tkinter import * >import tkMessageBox >import tkFileDialog > >import keyword >from string import ascii_letters, digits, punctuation > >OS = os.name.lower() #Should be 'ce' on WinCE > >class idle: > """The base class for the mini idle.""" > def __init__(self,root): > self.root = root > root.grid_rowconfigure(0, weight=1) > root.grid_columnconfigure(0, weight=1) > > frame = Frame(root) > frame.grid(row=0,column=0,sticky=N+W) > > btn = Button(frame,text="file",command=self.file_dialog) > btn.pack(side=LEFT) > > btn = Button(frame,text="edit",command=self.edit_dialog) > btn.pack(side=LEFT) > > btn = Button(frame,text="about",command=self.about_dialog) > btn.pack(side=LEFT) > > self.editor = SyntaxHighlightingText(root) > self.editor.grid(row=1,column=0,columnspan=2,sticky=N+S) > > panbar = Scrollbar(root,orient=HORIZONTAL) > panbar.grid(row=2,column=0,columnspan=2,sticky=E+W) > > scrollbar = Scrollbar(root) > scrollbar.grid(row=1,column=2,sticky=N+S) > > self.editor.configure(xscrollcommand=panbar.set) > self.editor.configure(yscrollcommand=scrollbar.set) > > scrollbar.config(command=self.editor.yview) > panbar.config(command=self.editor.xview) > > self.root.protocol("WM_DELETE_WINDOW", self.exit) > > def file_dialog(self): > """Used instead of a menu since menus don't work on WinCE.""" > top = Toplevel(padx=20) > top.title("file") > top.resizable(0,0) > top.focus_set() > > btn_task = Button(top, text="New",command=self.new) > btn_task.pack(fill=X) > > btn_task = Button(top, text="Open",command=self.open) > btn_task.pack(fill=X) > > btn_task = Button(top, text="Save",command=self.save) > btn_task.pack(fill=X) > > btn_task = Button(top, text="Save As",command=self.saveas) > btn_task.pack(fill=X) > > btn = Button(top, text="Exit", command=self.exit) > btn.pack(fill=X) > > def edit_dialog(self): > """These buttons all work on the desktop, but don't seem to work right >on WinCE. Luckly copy and paste are accessable via mouse clicks.""" > top = Toplevel(padx=20) > top.title("edit") > top.resizable(0,0) > top.focus_set() > > btn_undo = Button(top, text="Undo",command=self.editor.edit_undo) > btn_undo.pack(fill=X) > > btn_redo = Button(top, text="Redo",command=self.editor.edit_redo) > btn_redo.pack(fill=X) > > btn_task = Button(top, text="Cut",command=self.editor.cut) > btn_task.pack(fill=X) > > btn_task = Button(top, text="Copy",command=self.editor.copy) > btn_task.pack(fill=X) > > btn_task = Button(top, text="Paste",command=self.editor.paste) > btn_task.pack(fill=X) > > btn = Button(top, text="Dismiss", command=top.destroy) > btn.pack(fill=X) > > def about_dialog(self): > """Sillyness""" > top = Toplevel() > top.title("about") > top.resizable(0,0) > top.focus_set() > > about = """ > > IdleCE v0.6 > > A miniaturized imitation of > the python ide: idle. > > This software is distibuted > under the Gnu-GPL. Please Visit > http://www.gnu.org/licenses/gpl.txt > to see the license. > """ > info = Label(top,text=about) > info.pack(side=TOP,padx=6) > > button = Button(top, text="Dismiss", command=top.destroy) > button.pack(side=BOTTOM,fill=X) > > def open(self): > # Opens a file and colorizes it > self.filename = tkFileDialog.askopenfilename() > if OS == 'ce': # Just passing filename fails... > self.filename = self.filename.replace('/','\\') > try: > file = open(self.filename) > self.editor.delete("1.0",END) > text = file.readlines() > file.close() > for i in range(len(text)-1): > self.editor.insert(END,text[i]) > self.editor.colorize(i+1,len(text[i])) #colorize(textline,lastcolumn) > self.editor.see("1.0") > except IOError: > print self.filename > > def saveas(self): > # Called if no filename is set or Saveas is picked > self.filename = tkFileDialog.asksaveasfilename() > if OS == 'ce': > self.filename = self.filename.replace('/','\\') > try: > file = open(self.filename,'w') > text = self.editor.get("1.0",END) > file.write(text) > file.flush() > file.close() > except Exception, info: > tkMessageBox.showerror('Exception!',info) > > def save(self): > try: > file = open(self.filename,'w') > text = self.editor.get("1.0",END) > file.write(text) > file.flush() > file.close() > except: > self.saveas() # If no file has been accessed > > def new(self): > if len(self.editor.get("1.0",END)) >= 2: > if tkMessageBox.askokcancel("New File","Discard current file?"): > self.editor.delete("1.0",END) > self.filename = "" > else: > self.editor.delete("1.0",END) > self.filename = "" > > def exit(self): > # End the program firmly. > root.destroy() > root.quit() > >class SyntaxHighlightingText(Text): > """A syntax highlighting text widget from the web customized with >some methods from Idle and some special methods.""" > tags = {'com':'#C00', #comment > 'str':'#0A0', #string > 'kw': 'orange', #keyword > 'obj':'#00F', #function/class name > 'int': 'blue' #integers > } > > def __init__(self, root): > if OS == 'ce': > w = 40 > h = 10 > else: > w = 80 > h = 25 > Text.__init__(self,root,wrap=NONE,bd=0,width=w,height=h,undo=1,maxundo=50) > # Non-wrapping, no border, undo turned on, max undo 50 > self.text = self # For the methods taken from IDLE > self.root = root > self.config_tags() > self.characters = ascii_letters + digits + punctuation > self.tabwidth = 8 # for IDLE use, must remain 8 until Tk is fixed > self.indentwidth = 4 # Should perhaps be 2 due to the small screen?? > self.indention = 0 # The current indention level > self.set_tabwidth(self.indentwidth) # IDLE... > > # create a popup menu > self.menu = Menu(root, tearoff=0) > self.menu.add_command(label="Undo", command=self.edit_undo) > self.menu.add_command(label="Redo", command=self.edit_redo) > #self.menu.add_command(type="separator") > self.menu.add_command(label="Cut", command=self.cut) > self.menu.add_command(label="Copy", command=self.copy) > self.menu.add_command(label="Paste", command=self.paste) > > self.bind('', self.key_press) # For scanning input > self.bind('',self.autoindent) # Overides default binding > self.bind('',self.autoindent) # increments self.indention > self.bind('',self.autoindent)# decrements self.indention > self.bind('',self.paste)# decrements self.indention > self.tag_bind(SEL,'',self.popup) > > def popup(self, event): > """Edit popup menu with a special attribute for cut and copy.""" > Selection=self.get_selection_indices() > if len(Selection)>0: > SelectedText = self.get(Selection[0],Selection[1]) > self.sel_store = list(Selection) > self.sel_store.extend([SelectedText]) > self.menu.post(event.x_root, event.y_root) > > def get_tabwidth(self): > # From IDLE > current = self['tabs'] or 5000 > return int(current) > > def set_tabwidth(self, newtabwidth): > # From IDLE > text = self > if self.get_tabwidth() != newtabwidth: > pixels = text.tk.call("font", "measure", text["font"], > "-displayof", text.master, > "n" * newtabwidth) > text.configure(tabs=pixels) > > def config_tags(self): > # Sets up the tags and their colors > for tag, val in self.tags.items(): > self.tag_config(tag, foreground=val) > > def remove_tags(self, start, end): > for tag in self.tags.keys(): > self.tag_remove(tag, start, end) > > def get_selection_indices(self): > # If a selection is defined in the text widget, return (start, > # end) as Tkinter text indices, otherwise return (None, None) > try: > first = self.text.index("sel.first") > last = self.text.index("sel.last") > return first, last > except TclError: > return None, None > > def cut(self,event=0): > self.clipboard_clear() > if self.sel_store: # Sent by the popup > self.delete(self.sel_store[0],self.sel_store[1]) > self.clipboard_append(self.sel_store[2]) > self.sel_store = [] > else: # Sent by menu > Selection=self.get_selection_indices() > if len(Selection)>0: > SelectedText = self.get(Selection[0],Selection[1]) > self.delete(Selection[0],Selection[1]) > self.clipboard_append(SelectedText) > > def copy(self,event=0): > self.clipboard_clear() > if self.sel_store: # Sent by the popup > self.clipboard_append(self.sel_store[2]) > self.sel_store = [] > else: # Sent by menu > Selection=self.get_selection_indices() > if len(Selection)>0: > SelectedText = self.get(Selection[0],Selection[1]) > self.clipboard_append(SelectedText) > > def paste(self,event=0): > # This should call colorize for the pasted lines. > SelectedText = self.root.selection_get(selection='CLIPBOARD') > self.insert(INSERT, SelectedText) > return "break" > > def autoindent(self,event): > if event.keysym == 'Return': > self.edit_separator() # For undo/redo > index = self.index(INSERT).split('.') > print index > line = int(index[0]) > column = int(index[1]) > if self.get('%s.%d'%(line, column-1)) == ':': > self.indention += 1 > print '\n', > print '\t'*self.indention > self.insert(INSERT,'\n') > self.insert(INSERT,'\t'*self.indention) > return 'break' # Overides standard bindings > elif event.keysym == 'Tab': > self.edit_separator() > self.indention += 1 > print self.indention > elif event.keysym == 'BackSpace': > self.edit_separator() > index = self.index(INSERT).split('.') > print index > line = int(index[0]) > column = int(index[1]) > if self.get('%s.%d'%(line, column-1)) == '\t': > self.indention -= 1 > > def key_press(self, key): > """This function was origonaly the home of the colorize code. >Now it is mostly useless unless you want to watch for a certain character.""" > if key.char in ' :[(]),"\'': > self.edit_separator() # For undo/redo > > cline = self.index(INSERT).split('.')[0] > lastcol = 0 > char = self.get('%s.%d'%(cline, lastcol)) > while char != '\n': > lastcol += 1 > char = self.get('%s.%d'%(cline, lastcol)) > > self.colorize(cline,lastcol) > > def colorize(self,cline,lastcol): > """Not so simple syntax highlighting.""" > buffer = self.get('%s.%d'%(cline,0),'%s.%d'%(cline,lastcol)) > tokenized = buffer.split(' ') > > self.remove_tags('%s.%d'%(cline, 0), '%s.%d'%(cline, lastcol)) > > quotes = 0 > start = 0 > for i in range(len(buffer)): > if buffer[i] in ['"',"'"]: # Doesn't distinguish between single and double quotes... > if quotes: > self.tag_add('str', '%s.%d'%(cline, start), '%s.%d'%(cline, i+1)) > quotes = 0 > else: > start = i > quotes = 1 > elif buffer[i] == '#': > self.tag_add('com', '%s.%d'%(cline, i), '%s.%d'%(cline, len(buffer))) > break > > start, end = 0, 0 > obj_flag = 0 > for token in tokenized: > end = start + len(token) > if obj_flag: > self.tag_add('obj', '%s.%d'%(cline, start), '%s.%d'%(cline, end)) > obj_flag = 0 > if token.strip() in keyword.kwlist: > self.tag_add('kw', '%s.%d'%(cline, start), '%s.%d'%(cline, end)) > if token.strip() in ['def','class']: > obj_flag = 1 > else: > for index in range(len(token)): > try: > int(token[index]) > except ValueError: > pass > else: > self.tag_add('int', '%s.%d'%(cline, start+index)) > > start += len(token)+1 > >if __name__ == '__main__': > root = Tk() > root.title('IdleCE') > if OS is 'ce': > root.maxsize(240,320) > app = idle(root) > root.mainloop() > > > >------------------------------------------------------------------------ > >_______________________________________________ >PythonCE mailing list >PythonCE@python.org >http://mail.python.org/mailman/listinfo/pythonce > > From anne.wangnick at t-online.de Wed Jan 5 19:12:23 2005 From: anne.wangnick at t-online.de (Anne Wangnick) Date: Wed Jan 5 19:12:41 2005 Subject: AW: [PythonCE] Minature IDLE for PythonCE In-Reply-To: <20041230220858.21113.qmail@web50203.mail.yahoo.com> Message-ID: Hi Ed, Nice work of yours! Herewith some improvements (real menus on top, support for "foreign" Windows CE versions like my German one, where the installation is in C:\\Programme\\Python\\lib, support for VGA screen with HI_RES_AWARE python, hide ugly additional Tkinter titlebar below PDA top taskbar). Please give it a try on a real 240x320 PDA -- I can test it only in the 240x320 emulation mode of my VGA PDA. Regards, Sebastian Wangnick -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von Ed Blake Gesendet: Donnerstag, 30. Dezember 2004 23:09 An: pythonce@python.org Betreff: [PythonCE] Minature IDLE for PythonCE Something fun, and maybe usefull. Since popup-menus work I will probably move most of the edit menu there. -------------- next part -------------- #IdleCE import sys for p in sys.path: if p[-12:].lower()=="python23.zip": sys.path.append(p+"\\lib-tk") break import os import re from Tkinter import * import tkMessageBox import tkFileDialog import keyword from string import ascii_letters, digits, punctuation OS = os.name.lower() #Should be 'ce' on WinCE class idle: """The base class for the mini idle.""" def __init__(self,root): self.root = root root.grid_rowconfigure(1, weight=1) root.grid_columnconfigure(0, weight=1) frame = Frame(root) frame.grid(row=0,column=0,columnspan=2,sticky=NSEW) self.editor = SyntaxHighlightingText(root) self.editor.grid(row=1,column=0,columnspan=2,sticky=N+S) panbar = Scrollbar(root,orient=HORIZONTAL) panbar.grid(row=2,column=0,columnspan=2,sticky=E+W) scrollbar = Scrollbar(root) scrollbar.grid(row=1,column=2,sticky=N+S) self.editor.configure(xscrollcommand=panbar.set) self.editor.configure(yscrollcommand=scrollbar.set) scrollbar.config(command=self.editor.yview) panbar.config(command=self.editor.xview) btn = Menubutton(frame,text="File",padx=1,pady=1) btn.pack(side=LEFT) submenu = Menu(btn,tearoff=False) btn["menu"] = submenu submenu.add_command(label="New",command=self.new) submenu.add_command(label="Open",command=self.open) submenu.add_command(label="Save",command=self.save) submenu.add_command(label="Save as",command=self.saveas) submenu.add_command(label="Exit",command=self.exit) btn = Menubutton(frame,text="Edit",padx=1,pady=1) btn.pack(side=LEFT) submenu = Menu(btn,tearoff=False) btn["menu"] = submenu submenu.add_command(label="Undo",command=self.editor.edit_undo) submenu.add_command(label="Redo",command=self.editor.edit_redo) submenu.add_command(label="Cut",command=self.editor.cut) submenu.add_command(label="Copy",command=self.editor.copy) submenu.add_command(label="Paste",command=self.editor.paste) btn = Menubutton(frame,text="Help",padx=1,pady=1) btn.pack(side=LEFT) submenu = Menu(btn,tearoff=False) btn["menu"] = submenu submenu.add_command(label="About",command=self.about_dialog) self.root.protocol("WM_DELETE_WINDOW", self.exit) def about_dialog(self): """Sillyness""" top = Toplevel() top.title("about") top.resizable(0,0) top.focus_set() about = """ IdleCE v0.6.1 A miniaturized imitation of the python ide: idle. This software is distibuted under the Gnu-GPL. Please Visit http://www.gnu.org/licenses/gpl.txt to see the license. """ info = Label(top,text=about) info.pack(side=TOP,padx=6) button = Button(top, text="Dismiss", command=top.destroy) button.pack(side=BOTTOM,fill=X) def open(self): # Opens a file and colorizes it self.filename = tkFileDialog.askopenfilename() if OS == 'ce': # Just passing filename fails... self.filename = self.filename.replace('/','\\') try: file = open(self.filename) self.editor.delete("1.0",END) text = file.readlines() file.close() for i in range(len(text)-1): self.editor.insert(END,text[i]) self.editor.colorize(i+1,len(text[i])) #colorize(textline,lastcolumn) self.editor.see("1.0") except IOError: print self.filename def saveas(self): # Called if no filename is set or Saveas is picked self.filename = tkFileDialog.asksaveasfilename() if OS == 'ce': self.filename = self.filename.replace('/','\\') try: file = open(self.filename,'w') text = self.editor.get("1.0",END) file.write(text) file.flush() file.close() except Exception, info: tkMessageBox.showerror('Exception!',info) def save(self): try: file = open(self.filename,'w') text = self.editor.get("1.0",END) file.write(text) file.flush() file.close() except: self.saveas() # If no file has been accessed def new(self): if len(self.editor.get("1.0",END)) >= 2: if tkMessageBox.askokcancel("New File","Discard current file?"): self.editor.delete("1.0",END) self.filename = "" else: self.editor.delete("1.0",END) self.filename = "" def exit(self): # End the program firmly. root.destroy() root.quit() class SyntaxHighlightingText(Text): """A syntax highlighting text widget from the web customized with some methods from Idle and some special methods.""" tags = {'com':'#C00', #comment 'str':'#0A0', #string 'kw': 'orange', #keyword 'obj':'#00F', #function/class name 'int': 'blue' #integers } def __init__(self, root): if OS == 'ce': w = 40 h = 10 else: w = 80 h = 25 Text.__init__(self,root,wrap=NONE,bd=0,width=w,height=h,undo=1,maxundo=50,padx=0,pady=0) # Non-wrapping, no border, undo turned on, max undo 50 self.text = self # For the methods taken from IDLE self.root = root self.config_tags() self.characters = ascii_letters + digits + punctuation self.tabwidth = 8 # for IDLE use, must remain 8 until Tk is fixed self.indentwidth = 4 # Should perhaps be 2 due to the small screen?? self.indention = 0 # The current indention level self.set_tabwidth(self.indentwidth) # IDLE... # create a popup menu self.menu = Menu(root, tearoff=0) self.menu.add_command(label="Undo", command=self.edit_undo) self.menu.add_command(label="Redo", command=self.edit_redo) #self.menu.add_command(type="separator") self.menu.add_command(label="Cut", command=self.cut) self.menu.add_command(label="Copy", command=self.copy) self.menu.add_command(label="Paste", command=self.paste) self.bind('', self.key_press) # For scanning input self.bind('',self.autoindent) # Overides default binding self.bind('',self.autoindent) # increments self.indention self.bind('',self.autoindent)# decrements self.indention self.bind('',self.paste)# decrements self.indention self.tag_bind(SEL,'',self.popup) def popup(self, event): """Edit popup menu with a special attribute for cut and copy.""" Selection=self.get_selection_indices() if len(Selection)>0: SelectedText = self.get(Selection[0],Selection[1]) self.sel_store = list(Selection) self.sel_store.extend([SelectedText]) self.menu.post(event.x_root, event.y_root) def get_tabwidth(self): # From IDLE current = self['tabs'] or 5000 return int(current) def set_tabwidth(self, newtabwidth): # From IDLE text = self if self.get_tabwidth() != newtabwidth: pixels = text.tk.call("font", "measure", text["font"], "-displayof", text.master, "n" * newtabwidth) text.configure(tabs=pixels) def config_tags(self): # Sets up the tags and their colors for tag, val in self.tags.items(): self.tag_config(tag, foreground=val) def remove_tags(self, start, end): for tag in self.tags.keys(): self.tag_remove(tag, start, end) def get_selection_indices(self): # If a selection is defined in the text widget, return (start, # end) as Tkinter text indices, otherwise return (None, None) try: first = self.text.index("sel.first") last = self.text.index("sel.last") return first, last except TclError: return None, None def cut(self,event=0): self.clipboard_clear() if self.sel_store: # Sent by the popup self.delete(self.sel_store[0],self.sel_store[1]) self.clipboard_append(self.sel_store[2]) self.sel_store = [] else: # Sent by menu Selection=self.get_selection_indices() if len(Selection)>0: SelectedText = self.get(Selection[0],Selection[1]) self.delete(Selection[0],Selection[1]) self.clipboard_append(SelectedText) def copy(self,event=0): self.clipboard_clear() if self.sel_store: # Sent by the popup self.clipboard_append(self.sel_store[2]) self.sel_store = [] else: # Sent by menu Selection=self.get_selection_indices() if len(Selection)>0: SelectedText = self.get(Selection[0],Selection[1]) self.clipboard_append(SelectedText) def paste(self,event=0): # This should call colorize for the pasted lines. SelectedText = self.root.selection_get(selection='CLIPBOARD') self.insert(INSERT, SelectedText) return "break" def autoindent(self,event): if event.keysym == 'Return': self.edit_separator() # For undo/redo index = self.index(INSERT).split('.') print index line = int(index[0]) column = int(index[1]) if self.get('%s.%d'%(line, column-1)) == ':': self.indention += 1 print '\n', print '\t'*self.indention self.insert(INSERT,'\n') self.insert(INSERT,'\t'*self.indention) return 'break' # Overides standard bindings elif event.keysym == 'Tab': self.edit_separator() self.indention += 1 print self.indention elif event.keysym == 'BackSpace': self.edit_separator() index = self.index(INSERT).split('.') print index line = int(index[0]) column = int(index[1]) if self.get('%s.%d'%(line, column-1)) == '\t': self.indention -= 1 def key_press(self, key): """This function was origonaly the home of the colorize code. Now it is mostly useless unless you want to watch for a certain character.""" if key.char in ' :[(]),"\'': self.edit_separator() # For undo/redo cline = self.index(INSERT).split('.')[0] lastcol = 0 char = self.get('%s.%d'%(cline, lastcol)) while char != '\n': lastcol += 1 char = self.get('%s.%d'%(cline, lastcol)) self.colorize(cline,lastcol) def colorize(self,cline,lastcol): """Not so simple syntax highlighting.""" buffer = self.get('%s.%d'%(cline,0),'%s.%d'%(cline,lastcol)) tokenized = buffer.split(' ') self.remove_tags('%s.%d'%(cline, 0), '%s.%d'%(cline, lastcol)) quotes = 0 start = 0 for i in range(len(buffer)): if buffer[i] in ['"',"'"]: # Doesn't distinguish between single and double quotes... if quotes: self.tag_add('str', '%s.%d'%(cline, start), '%s.%d'%(cline, i+1)) quotes = 0 else: start = i quotes = 1 elif buffer[i] == '#': self.tag_add('com', '%s.%d'%(cline, i), '%s.%d'%(cline, len(buffer))) break start, end = 0, 0 obj_flag = 0 for token in tokenized: end = start + len(token) if obj_flag: self.tag_add('obj', '%s.%d'%(cline, start), '%s.%d'%(cline, end)) obj_flag = 0 if token.strip() in keyword.kwlist: self.tag_add('kw', '%s.%d'%(cline, start), '%s.%d'%(cline, end)) if token.strip() in ['def','class']: obj_flag = 1 else: for index in range(len(token)): try: int(token[index]) except ValueError: pass else: self.tag_add('int', '%s.%d'%(cline, start+index)) start += len(token)+1 if __name__ == '__main__': root = Tk() root.title('IdleCE') if OS=='ce': sizex, sizey = root.wm_maxsize() root.wm_geometry("%dx%d+0+%d"%(sizex-6,sizey*37/64+1,sizey/90)) app = idle(root) root.mainloop() From anne.wangnick at t-online.de Wed Jan 5 20:31:39 2005 From: anne.wangnick at t-online.de (Anne Wangnick) Date: Wed Jan 5 20:32:04 2005 Subject: AW: [PythonCE] Minature IDLE for PythonCE In-Reply-To: Message-ID: Dear all, I've managed to find a workaround for the Tkinter text widget selection problems. I've filed the issue also to http://wiki.tcl.tk/9184 to get it solved in the long run. You have to add something like the following code to your applications using text widgets: b1motion = root.bind_class('Text','') root.bind_class('Text','','if {![info exists ::tk::Priv(ignoreB1Motion)]} {%s}'%b1motion) root.bind_class('Text','','set ::tk::Priv(ignoreB1Motion) 1') root.bind_class('Text','','array unset ::tk::Priv ignoreB1Motion') Ed, an updated version of your most recent distribution of IdleCE is attached. Regards, Sebastian -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von Ed Blake Gesendet: Mittwoch, 5. Januar 2005 01:58 An: pythonce@python.org Betreff: [PythonCE] Mini IDLE update and response. I've managed to get popup menus that work. Highlight some text, tap the selection and a menu will appear. It is equivalent to the edit menu/window but seems to work better for cut/copy. I have a problem with this though on my own device (HP Ipaq, WinCE 2003). When I try to highlight text the selection flickers and changes, like the selection is being made over and over. If anyone can figure out what causes this I would be interested in hearing about it. RE the license: I think the example code I based most of this app on was released GPL so unless I can track down the example again and verify its license... I suppose if I verify that the example was other than GPL I should use the python license as that is the license used on IDLE. -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von Anne Wangnick Gesendet: Mittwoch, 5. Januar 2005 19:12 An: Ed Blake Cc: pythonce@python.org Betreff: AW: [PythonCE] Minature IDLE for PythonCE Hi Ed, Nice work of yours! Herewith some improvements (real menus on top, support for "foreign" Windows CE versions like my German one, where the installation is in C:\\Programme\\Python\\lib, support for VGA screen with HI_RES_AWARE python, hide ugly additional Tkinter titlebar below PDA top taskbar). Please give it a try on a real 240x320 PDA -- I can test it only in the 240x320 emulation mode of my VGA PDA. Regards, Sebastian Wangnick -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von Ed Blake Gesendet: Donnerstag, 30. Dezember 2004 23:09 An: pythonce@python.org Betreff: [PythonCE] Minature IDLE for PythonCE Something fun, and maybe usefull. Since popup-menus work I will probably move most of the edit menu there. -------------- next part -------------- #IdleCE import sys for p in sys.path: if p[-12:].lower()=="python23.zip": sys.path.append(p+"\\lib-tk") break import os import re from Tkinter import * import tkMessageBox import tkFileDialog import keyword from string import ascii_letters, digits, punctuation OS = os.name.lower() #Should be 'ce' on WinCE class idle: """The base class for the mini idle.""" def __init__(self,root): self.root = root root.grid_rowconfigure(1, weight=1) root.grid_columnconfigure(0, weight=1) frame = Frame(root) frame.grid(row=0,column=0,columnspan=2,sticky=NSEW) self.editor = SyntaxHighlightingText(root) self.editor.grid(row=1,column=0,columnspan=2,sticky=N+S) panbar = Scrollbar(root,orient=HORIZONTAL) panbar.grid(row=2,column=0,columnspan=2,sticky=E+W) scrollbar = Scrollbar(root) scrollbar.grid(row=1,column=2,sticky=N+S) self.editor.configure(xscrollcommand=panbar.set) self.editor.configure(yscrollcommand=scrollbar.set) scrollbar.config(command=self.editor.yview) panbar.config(command=self.editor.xview) btn = Menubutton(frame,text="File",padx=1,pady=1) btn.pack(side=LEFT) submenu = Menu(btn,tearoff=False) btn["menu"] = submenu submenu.add_command(label="New",command=self.new) submenu.add_command(label="Open",command=self.open) submenu.add_command(label="Save",command=self.save) submenu.add_command(label="Save as",command=self.saveas) submenu.add_command(label="Exit",command=self.exit) btn = Menubutton(frame,text="Edit",padx=1,pady=1) btn.pack(side=LEFT) submenu = Menu(btn,tearoff=False) btn["menu"] = submenu submenu.add_command(label="Undo",command=self.editor.edit_undo) submenu.add_command(label="Redo",command=self.editor.edit_redo) submenu.add_command(label="Cut",command=self.editor.cut) submenu.add_command(label="Copy",command=self.editor.copy) submenu.add_command(label="Paste",command=self.editor.paste) btn = Menubutton(frame,text="Help",padx=1,pady=1) btn.pack(side=LEFT) submenu = Menu(btn,tearoff=False) btn["menu"] = submenu submenu.add_command(label="About",command=self.about_dialog) self.root.protocol("WM_DELETE_WINDOW", self.exit) def about_dialog(self): """Sillyness""" top = Toplevel() top.title("about") top.resizable(0,0) top.focus_set() about = """ IdleCE v0.6.2 A miniaturized imitation of the python ide: idle. This software is distibuted under the Gnu-GPL. Please Visit http://www.gnu.org/licenses/gpl.txt to see the license. """ info = Label(top,text=about) info.pack(side=TOP,padx=6) button = Button(top, text="Dismiss", command=top.destroy) button.pack(side=BOTTOM,fill=X) def open(self): # Opens a file and colorizes it self.filename = tkFileDialog.askopenfilename() if OS == 'ce': # Just passing filename fails... self.filename = self.filename.replace('/','\\') try: file = open(self.filename) self.editor.delete("1.0",END) text = file.readlines() file.close() for i in range(len(text)-1): self.editor.insert(END,text[i]) self.editor.colorize(i+1,len(text[i])) #colorize(textline,lastcolumn) self.editor.see("1.0") except IOError: print self.filename def saveas(self): # Called if no filename is set or Saveas is picked self.filename = tkFileDialog.asksaveasfilename() if OS == 'ce': self.filename = self.filename.replace('/','\\') try: file = open(self.filename,'w') text = self.editor.get("1.0",END) file.write(text) file.flush() file.close() except Exception, info: tkMessageBox.showerror('Exception!',info) def save(self): try: file = open(self.filename,'w') text = self.editor.get("1.0",END) file.write(text) file.flush() file.close() except: self.saveas() # If no file has been accessed def new(self): if len(self.editor.get("1.0",END)) >= 2: if tkMessageBox.askokcancel("New File","Discard current file?"): self.editor.delete("1.0",END) self.filename = "" else: self.editor.delete("1.0",END) self.filename = "" def exit(self): # End the program firmly. root.destroy() root.quit() class SyntaxHighlightingText(Text): """A syntax highlighting text widget from the web customized with some methods from Idle and some special methods.""" tags = {'com':'#C00', #comment 'str':'#0A0', #string 'kw': 'orange', #keyword 'obj':'#00F', #function/class name 'int': 'blue' #integers } def __init__(self, root): if OS == 'ce': w = 40 h = 10 else: w = 80 h = 25 Text.__init__(self,root,wrap=NONE,bd=0,width=w,height=h,undo=1,maxundo=50,padx=0,pady=0) # Non-wrapping, no border, undo turned on, max undo 50 self.text = self # For the methods taken from IDLE self.root = root self.config_tags() self.characters = ascii_letters + digits + punctuation self.tabwidth = 8 # for IDLE use, must remain 8 until Tk is fixed self.indentwidth = 4 # Should perhaps be 2 due to the small screen?? self.indention = 0 # The current indention level self.set_tabwidth(self.indentwidth) # IDLE... # create a popup menu self.menu = Menu(root, tearoff=0) self.menu.add_command(label="Undo", command=self.edit_undo) self.menu.add_command(label="Redo", command=self.edit_redo) #self.menu.add_command(type="separator") self.menu.add_command(label="Cut", command=self.cut) self.menu.add_command(label="Copy", command=self.copy) self.menu.add_command(label="Paste", command=self.paste) self.bind('', self.key_press) # For scanning input self.bind('',self.autoindent) # Overides default binding self.bind('',self.autoindent) # increments self.indention self.bind('',self.autoindent)# decrements self.indention self.bind('',self.paste)# decrements self.indention self.tag_bind(SEL,'',self.popup) def popup(self, event): """Edit popup menu with a special attribute for cut and copy.""" Selection=self.get_selection_indices() if len(Selection)>0: SelectedText = self.get(Selection[0],Selection[1]) self.sel_store = list(Selection) self.sel_store.extend([SelectedText]) self.menu.post(event.x_root, event.y_root) def get_tabwidth(self): # From IDLE current = self['tabs'] or 5000 return int(current) def set_tabwidth(self, newtabwidth): # From IDLE text = self if self.get_tabwidth() != newtabwidth: pixels = text.tk.call("font", "measure", text["font"], "-displayof", text.master, "n" * newtabwidth) text.configure(tabs=pixels) def config_tags(self): # Sets up the tags and their colors for tag, val in self.tags.items(): self.tag_config(tag, foreground=val) def remove_tags(self, start, end): for tag in self.tags.keys(): self.tag_remove(tag, start, end) def get_selection_indices(self): # If a selection is defined in the text widget, return (start, # end) as Tkinter text indices, otherwise return (None, None) try: first = self.text.index("sel.first") last = self.text.index("sel.last") return first, last except TclError: return None, None def cut(self,event=0): self.clipboard_clear() if self.sel_store: # Sent by the popup self.delete(self.sel_store[0],self.sel_store[1]) self.clipboard_append(self.sel_store[2]) self.sel_store = [] else: # Sent by menu Selection=self.get_selection_indices() if len(Selection)>0: SelectedText = self.get(Selection[0],Selection[1]) self.delete(Selection[0],Selection[1]) self.clipboard_append(SelectedText) def copy(self,event=0): self.clipboard_clear() if self.sel_store: # Sent by the popup self.clipboard_append(self.sel_store[2]) self.sel_store = [] else: # Sent by menu Selection=self.get_selection_indices() if len(Selection)>0: SelectedText = self.get(Selection[0],Selection[1]) self.clipboard_append(SelectedText) def paste(self,event=0): # This should call colorize for the pasted lines. SelectedText = self.root.selection_get(selection='CLIPBOARD') self.insert(INSERT, SelectedText) return "break" def autoindent(self,event): if event.keysym == 'Return': self.edit_separator() # For undo/redo index = self.index(INSERT).split('.') print index line = int(index[0]) column = int(index[1]) if self.get('%s.%d'%(line, column-1)) == ':': self.indention += 1 print '\n', print '\t'*self.indention self.insert(INSERT,'\n') self.insert(INSERT,'\t'*self.indention) return 'break' # Overides standard bindings elif event.keysym == 'Tab': self.edit_separator() self.indention += 1 print self.indention elif event.keysym == 'BackSpace': self.edit_separator() index = self.index(INSERT).split('.') print index line = int(index[0]) column = int(index[1]) if self.get('%s.%d'%(line, column-1)) == '\t': self.indention -= 1 def key_press(self, key): """This function was origonaly the home of the colorize code. Now it is mostly useless unless you want to watch for a certain character.""" if key.char in ' :[(]),"\'': self.edit_separator() # For undo/redo cline = self.index(INSERT).split('.')[0] lastcol = 0 char = self.get('%s.%d'%(cline, lastcol)) while char != '\n': lastcol += 1 char = self.get('%s.%d'%(cline, lastcol)) self.colorize(cline,lastcol) def colorize(self,cline,lastcol): """Not so simple syntax highlighting.""" buffer = self.get('%s.%d'%(cline,0),'%s.%d'%(cline,lastcol)) tokenized = buffer.split(' ') self.remove_tags('%s.%d'%(cline, 0), '%s.%d'%(cline, lastcol)) quotes = 0 start = 0 for i in range(len(buffer)): if buffer[i] in ['"',"'"]: # Doesn't distinguish between single and double quotes... if quotes: self.tag_add('str', '%s.%d'%(cline, start), '%s.%d'%(cline, i+1)) quotes = 0 else: start = i quotes = 1 elif buffer[i] == '#': self.tag_add('com', '%s.%d'%(cline, i), '%s.%d'%(cline, len(buffer))) break start, end = 0, 0 obj_flag = 0 for token in tokenized: end = start + len(token) if obj_flag: self.tag_add('obj', '%s.%d'%(cline, start), '%s.%d'%(cline, end)) obj_flag = 0 if token.strip() in keyword.kwlist: self.tag_add('kw', '%s.%d'%(cline, start), '%s.%d'%(cline, end)) if token.strip() in ['def','class']: obj_flag = 1 else: for index in range(len(token)): try: int(token[index]) except ValueError: pass else: self.tag_add('int', '%s.%d'%(cline, start+index)) start += len(token)+1 if __name__ == '__main__': root = Tk() root.title('IdleCE') if OS=='ce': sizex, sizey = root.wm_maxsize() root.wm_geometry("%dx%d+0+%d"%(sizex-6,sizey*37/64+1,sizey/90)) b1motion = root.bind_class('Text','') root.bind_class('Text','','if {![info exists ::tk::Priv(ignoreB1Motion)]} {%s}'%b1motion) root.bind_class('Text','','set ::tk::Priv(ignoreB1Motion) 1') root.bind_class('Text','','array unset ::tk::Priv ignoreB1Motion') app = idle(root) root.mainloop() From mike at pcblokes.com Thu Jan 6 16:40:03 2005 From: mike at pcblokes.com (Michael Foord) Date: Thu Jan 6 16:40:13 2005 Subject: [PythonCE] Mini IDLE update and response. In-Reply-To: <20050105180400.73396.qmail@web50207.mail.yahoo.com> References: <20050105180400.73396.qmail@web50207.mail.yahoo.com> Message-ID: <41DD5BD3.2050504@pcblokes.com> Ed Blake wrote: >Good suggestions, and I'm glad this is helpful to someone. I defiantly agree >about having only one instance of a menu window. I think it will be fairly >simple to fix this behavior, I was just too lazy to fix it in this 'release'. > >About the key bindings, all the general windows key bindings should already >exist. So ctrl-c,v,x,z,y should all work, shift selecting. What would be >nice is if I could bind some of the hardware keys to things like shift alt >and control... > > Hello Ed (and Sebastian), IdleCE gets better and better. On PPC2002 though - I can report that 'standard' key bindings *do not* work. You get weird control characters isntead. Certainly in a normal Tkinter text box the key bindings have to be done explicitly (I think ?). Despite that - IdleCE is great, particularly with the reduced flicker on selection. Thank you. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml >Tabs are an interesting question, I agree that spaces would be preferable for >indention, but I am using built-in Tk methods to handle tabs currently so >I'll need to re-write some code. I already added some simple autoindention, >adding a tab if the last char in the line was a colon. I think I could setup >a key binding for indent/dedent of a selection, I'll have to try and see. I >suppose I will work on indention next. > >Lastly if you wanted to put this thing on the web somewhere I would not >object. I would suggest you wait a little while though, once I incorporate >these changes into the program it will be much nicer and more usable. > >Anyway thanks for the response. I will try to keep improving this as much as >I can, but others are welcome to play with/improve it too. > >--- Michael Foord wrote: > > > >>Hello Ed, >> >>is great - it's the first useful python app. for windows CE that I've >>seen - awesome. MANY MANY thanks for your work. >> >>It's been such a pain coding with pocket notepad ! >>I've noticed the problem with selection as well - I guess it's a problem >>with the WinCE port of Tk. The best you can do is fix the keybindings to >>the cursor keys, so that selection can be done with the shift-arrow >>keys. Maybe even implement ctrl-something-or-other to select a block at >>a time ! >> >>Anyway - I have a bit of a wish list for IdleCE. *Mainly* related to key >>bindings, but not entirely. If you could bear these in mind, I would be >>personally very grateful. >> >>In order of importance : >> >>max 1 edit and file menu open at a time >>key bindings to ctrl-c, ctr-x, ctrl-a, ctrl-v, ctrl-s (copy, cut, select >>all, paste, save) >>Also shift- for selection >> >>tab for indenting selected area >>ctrl-[ and ctrl-] for indenting/unindenting selected area >> >>tab is four spaces rather than tab >>(and/or a spaces to tabs/tabs to spaces option) >> >>comment in/comment out areas - with key bindings >> >> >>As I said though... I already use IdleCE and am grateful for your work. >>Do you want this put online somewhere ? Contact me off-list if you do. >> >>Regards, >> >>Fuzzyman >>http://www.voidspace.org.uk/python/index.shtml >> >> >> >> >> >=== message truncated === > > > > > From isrgish at fastem.com Fri Jan 7 04:16:50 2005 From: isrgish at fastem.com (Isr Gish) Date: Fri Jan 7 04:17:19 2005 Subject: AW: [PythonCE] Minature IDLE for PythonCE Message-ID: <20050107031718.F30151E4006@bag.python.org> Thanks Ed & Anna. This is a great app and very usefull. There is one small thing I would mention. That it would be great if on exiting, the app would check if there is any changes, and then ask if want to save changes. All the best, Isr From isrgish at fastem.com Fri Jan 7 04:27:13 2005 From: isrgish at fastem.com (Isr Gish) Date: Fri Jan 7 04:27:42 2005 Subject: [PythonCE] Mini IDLE update and response. Message-ID: <20050107032740.E7FE41E4006@bag.python.org> Hello Ed, "Michael Foord" wrote: >Ed Blake wrote: > >>Good suggestions, and I'm glad this is helpful to someone. I defiantly agree >>about having only one instance of a menu window. I think it will be fairly >>simple to fix this behavior, I was just too lazy to fix it in this 'release'. >> >>About the key bindings, all the general windows key bindings should already >>exist. So ctrl-c,v,x,z,y should all work, shift selecting. What would be >>nice is if I could bind some of the hardware keys to things like shift alt >>and control... >> >> > >Hello Ed (and Sebastian), > >IdleCE gets better and better. On PPC2002 though - I can report that >'standard' key bindings *do not* work. You get weird control characters >isntead. Certainly in a normal Tkinter text box the key bindings have >to be done explicitly (I think ?). I'm on a 2003 device (First edition). And also seem to have wiered chars coming up when I try ctrl c,x,a etc. All the best, Isr From kitsune_e at yahoo.com Fri Jan 7 23:49:38 2005 From: kitsune_e at yahoo.com (Ed Blake) Date: Sat Jan 8 01:29:58 2005 Subject: [PythonCE] More Idle distractions Message-ID: <20050107224938.60759.qmail@web50205.mail.yahoo.com> Okay, I've spent some more time playing with this program. There are a bunch of changes but the biggest is probably my switch from IDLE to LEO for development. I don't want to proselytize too much but Leo is a great tool. It allows you to easily organize a large amount of data, notes, example, and code in a logical way, and also to generate a number of documents from one leo file. If anyone is interested I could post my leo file for IdleCE. Some stuff is missing since I lost things before moving to Leo, but it still could be insightful. Anyway this release added/improved on the editing features, incorporates Sabastion's menus and his fix for the selection bug, and just some general repairs. I've also added a new bug, don't try to indent a selection if the selection includes the last line in a file. Its a strange bug but all you need is a extra newline at the end of the file to avoid it. I can't remember if I said anything about it before but one of my favorite features is the 'context' menu. Select some text and tap on the selection, a menu will appear with common editing options. It might be cool if I could expand this to be truly context sensitive. Maybe some kind of word completion/insertion... I also thought a special clipboard might be cool, something like kclipper on KDE. Oh well, I have some other stuff to try before I get to the fancy stuff. -------------- next part -------------- A non-text attachment was scrubbed... Name: IdleCE.py Type: text/x-python Size: 20214 bytes Desc: IdleCE.py Url : http://mail.python.org/pipermail/pythonce/attachments/20050107/f954fb11/IdleCE.py From bockman at virgilio.it Sat Jan 8 15:13:33 2005 From: bockman at virgilio.it (Francesco Bochicchio) Date: Sat Jan 8 15:13:40 2005 Subject: [PythonCE] Newbie questions Message-ID: <20050108141332.GA3122@virgilio.it> Hi all, I just got an HP Ipaq rx1710 (WinMobile 2003) and I had already installed PythonCE 2.2 (the HPC CAB) on it. I'm planning to have fun writing some nice little program for my new toy (actually, I would like to write some game, but I will start smaller). I'v googled around for info in python in this platform but I still have some doubts: - Is 2.2 the latest python version available for Win[CE/Mobile]? - - Where I can find small programs in pythonCE? (I know python quite well, but not much of win32 modules, which I gathered are the best (only?) choice to interact with the handheld environment). Also, I would appreciate answers to a couple of non-python questions: - What is the difference between PPC and HPC? (The terms are widely used in the PythonCE wiki, but I could not find any explanations) - Is there any other free cross-development tool for my handheld (I'm specially interested in C/C++ cross-compilers). Thanks in advance for any answer Ciao ---- FB From bkc at murkworks.com Sat Jan 8 16:38:32 2005 From: bkc at murkworks.com (Brad Clements) Date: Sat Jan 8 16:19:34 2005 Subject: [PythonCE] Re: Newbie questions Message-ID: <41DFB395.15978.810B803A@coal.murkworks.com> On 8 Jan 2005 at 15:13, Francesco Bochicchio wrote: > - Is 2.2 the latest python version available for Win[CE/Mobile]? No, version 2.3.4 is currently available from the pythonce project on sourceforge. Also see http://fore.validus.com/~kashtan/ > - Where I can find small programs in pythonCE? (I know python > quite well, but not much of win32 modules, which I gathered are > the best (only?) choice to interact with the handheld > environment). I'm not sure where to find other small programs as examples. You might check this list's archives. Apparently there is also tk available for PPC now. There's been a lot of recent activity on this list about tk and IDLE, check the archive for this week. > - What is the difference between PPC and HPC? (The terms > are widely used in the PythonCE wiki, but I could not find any > explanations) HPC is the hand-held PC form factor. PPC is the Pocket PC form factor. HPC devices have a physical keyboard, whereas PPC devices have a virtual on-screen keyboard. Note, however, that this is changing with some Windows Mobile smartphones now having slide-out keyboards. Benq P50 recently mentioned on Engadget site, and I think the Siemens SX66 and others have slide out keyboards. Typically older HPC devices run Windows CE 1.0, 2.1. Newer ones run CE 3.0. The HPC devices have a start bar at the bottom of the screen. PPC Devices, like the original iPaQ, run the Pocket PC 2000, 2002 and 2003 OS. Newer PPC devices run Windows Smartphone and Windows Mobile. There was also a PSPC (Palm Size PC) which runs Palm OS (like the Philips Nino) > - Is there any other free cross-development tool for my handheld > (I'm specially interested in C/C++ cross-compilers). http://msdn.microsoft.com has a whole section devoted to "Windows Mobile" and "Windows Embedded" Development tools, including free downloads of the embedded C++ tools and SDKs for various platforms. All of these tools run on Windows, of course. They also include emulators.. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20050108/88e5cbd1/attachment.html From stewart.midwinter at gmail.com Sat Jan 8 18:28:21 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sat Jan 8 18:28:24 2005 Subject: [PythonCE] PythonCE with VGA screens? Message-ID: I've installed Python 2.3 on my Toshiba e830 and am working on a Tkinter app. The e830 has a VGA screen, so I set the root geometry to a width of 480, height of 640, and was surprised to find that my root window was larger than the screen. When I set its dimensions to 240x320, it fit the screen exactly. Is there a way to force Python to operate in VGA mode? I really want the extra screen real estate! thanks, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From bkc at murkworks.com Sat Jan 8 19:48:52 2005 From: bkc at murkworks.com (Brad Clements) Date: Sat Jan 8 19:29:49 2005 Subject: [PythonCE] PythonCE with VGA screens? In-Reply-To: Message-ID: <41DFE031.25082.81B9C29F@coal.murkworks.com> On 8 Jan 2005 at 10:28, Stewart Midwinter wrote: > I've installed Python 2.3 on my Toshiba e830 and am working on a > Tkinter app. The e830 has a VGA screen, so I set the root geometry to > a width of 480, height of 640, and was surprised to find that my root > window was larger than the screen. When I set its dimensions to > 240x320, it fit the screen exactly. > > Is there a way to force Python to operate in VGA mode? I really want > the extra screen real estate! I don't have a VGA resolution device. However I think maybe you're seeing a compatibility "feature" that allows legacy apps to "look good" on VGA screens. Perhaps the OS is doubling the effective resolution because your app hasn't made a special call or have a bit set in it's PE header that tells the OS "hey, I grok 640x480". -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From anne.wangnick at t-online.de Sat Jan 8 22:47:07 2005 From: anne.wangnick at t-online.de (Anne Wangnick) Date: Sat Jan 8 22:47:24 2005 Subject: AW: [PythonCE] Support for VGA PDA's In-Reply-To: Message-ID: Dear all, attached python.exe as of Python-2.3.4-arm-PPC2003.zip from http://fore.validus.com/~kashtan/, modified (special resource HI_RES_AWARE introduced as described on http://wiki.tcl.tk/10103) to support full VGA resolution. Regards, Sebastian -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von Anne Wangnick Gesendet: Donnerstag, 18. November 2004 18:14 An: pythonce@python.org Betreff: [PythonCE] Support for VGA PDA's Dear all, this is to inform you that I've also successfully modified python.exe to support the VGA resolution on the new Pocket-PC's. Refer to http://wiki.tcl.tk/10103 for the instructions. Regards, Sebastian Wangnick _______________________________________________ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce -------------- next part -------------- A non-text attachment was scrubbed... Name: python.exe.gz Type: application/x-gzip Size: 11694 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20050108/2b6f5732/python.exe-0001.bin From stewart.midwinter at gmail.com Sat Jan 8 23:44:02 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sun Jan 9 00:12:05 2005 Subject: [PythonCE] idleCE Message-ID: I started on an editor yesterday because I'm not satisfied w Pocket Word or the editor in Total Commander. I didn't get too far - copy attached in next post. but I'd gladly suspend work & support idleCE instead - nice work! One addition that would be useful is a Go To Line Number N feature. Also, the possibility to copy text from one file to another - maybe the Notebook widget would be useful for that? cheers, S #FileEditor.py From stewart.midwinter at gmail.com Sun Jan 9 00:15:41 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sun Jan 9 00:15:45 2005 Subject: [PythonCE] re: Idle Message-ID: here's the attachment. Found out I could post wirelessly from my toshiba e830 via gmane, but you can't post an attachment that way. I have to use GMail for that, but it won't recognize Netfront or PIE as valid browsers; hence, back to the desktop for this posting. S -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com -------------- next part -------------- title = 'tkPPCedit' # Import Pmw from this directory tree. import sys, os sys.path.append('\\Program Files\\Python\\Lib\\python23.zip\\lib-tk') from Tkinter import * sys.path[:0] = ['\\SD Card'] import Pmw import os, os.path from tkMessageBox import showerror, showinfo from tkFileDialog import * class Editor: '''this class creates a scrolled text window that optionally will have a file's contents dumped into it. There are also methods for opening a file for editing, and saving it, and also clearing the window.''' def __init__(self, parent, location=None, filename=None): '''Create and pack the PanedWidget to hold the input window. !! panedwidget should automatically size to requested size ''' self.myPath = None self.location = location self.filename = filename #self.myPath = os.path.join(self.location, self.filename) if self.filename is None: self.myPath = self.location self.mytext = 'Not editing a file' else: self.myPath = self.location+'\\'+self.filename self.mytext = 'Now editing %s' % self.myPath panedWidget = Pmw.PanedWidget(parent, orient = 'vertical', hull_height = 280, hull_width = 220) panedWidget.add('input', min = 0.05) panedWidget.add('info', min = 0.05, max = 0.05) panedWidget.add('buttons', min = 0.1, max = 0.1) panedWidget.pack(fill = 'both', expand = 1) self.panedWidget = panedWidget buttonList = ( [2, None], ['Clear', self.clear], ['Open', Pmw.busycallback(self.getFile)], ['Save', Pmw.busycallback(self.saveFile)], ['Save as...', Pmw.busycallback(self.saveasFile)], ['Quit', Pmw.busycallback(self.close)], ['About', Pmw.busycallback(self.getabout)], ) self.buttonDict = {} ''' [50, None], ['Close', self.close], ''' infoFrame = panedWidget.pane('info') spacer= Label(infoFrame, width='1', text=' ') spacer.pack(side='left', fill='none') label = Label(infoFrame, text=self.mytext) label.pack(side='left',fill='none') self.label = label buttonFrame = panedWidget.pane('buttons') for text, cmd in buttonList: if type(text) == type(69): frame = Frame(buttonFrame, width = text) frame.pack(side = 'left') else: button = Button(buttonFrame, text = text, command = cmd) button.pack(side = 'left') self.buttonDict[text] = button self.input = Pmw.ScrolledText(panedWidget.pane('input'), text_wrap = 'none') self.input.pack(fill = 'both', expand = 1) '''if we were passed a filename, open file and show contents''' if self.location is not None and self.filename is not None: #fid = os.path.join(self.location, self.filename) fid = os.path.join(self.location, self.filename) self.getFile(self.location, self.filename) def clear(self): '''clear out the contents of the window''' self.input.delete('1.0', 'end') self.mytext = 'Now editing an empty file' self.label.config(text=self.mytext) self.myPath = None def close(self): '''close the window that we live in''' sys.exit() def addnewlines(self, text): '''how to handle line endings on inserted text this adds extra lines to every piece of text. we don't want that, so we'll comment it out.''' if len(text) == 1: text = text + '\n' if text[-1] != '\n': text = text + '\n' if text[-2] != '\n': text = text + '\n' return text def getFile(self, location=None, filename=None): '''open a file''' #firstly clear window self.clear() if location == None: location == "\\My Documents" else: os.chdir(location) if filename == None: myPath = askopenfilename(filetypes=[("text files", "*.*")]) msg = 'selected file is \n' +myPath #showinfo('Info', msg) myPath = os.path.normpath(myPath) if myPath is None or len(myPath) < 1: return else: myPath = location +'\\'+filename self.myPath = myPath try: fid = open(myPath, 'r') except IOError: showerror('No file', "Sorry, I can't find %s" % myPath) return lines = fid.readlines() fid.close() for line in lines: #self.input.insert('end', self.addnewlines(line)) self.input.insert('end', line) self.input.see('end') def saveFile(self): '''save a previously opened file''' if self.location is not None: os.chdir(self.location) if self.myPath is None: showerror('No file',"I don't know where to save the file!") self.saveasFile() else: fid = open(self.myPath, 'w+') #truncate lines = self.input.get() #put something in here fid.write(lines) fid.close() msg = 'Saved: %s' % self.myPath showinfo('Saved', msg) mytext = "Still editing %s" % self.myPath self.label.config(text=mytext) def saveasFile(self): '''save a file under a new name''' if self.location is not None: os.chdir(self.location) ans = asksaveasfilename() if ans is not None and len(ans) > 0: self.myPath = ans msg = 'selected file is: %s' % self.myPath #showinfo('Info', msg) self.myPath = os.path.normpath(self.myPath) fid = open(self.myPath, 'w+') #truncate lines = self.input.get() fid.write(lines) fid.close() msg = 'Saved: %s' % self.myPath showinfo('Saved', msg) mytext = "Now editing %s" % self.myPath else: mytext = 'Not editing a file' self.label.config(text=mytext) def getabout(self): ab = About() ab.execute() #showinfo('', '1') class About: def __init__(self): mytext = "tkPPC Editor v.0.1\n(c) Stewart Midwinter\nFreeware: use at your own peril. " self.mytext = mytext def execute(self): showinfo('', '2') a = Toplevel() l = Label(a, text = self.mytext) l.pack(side='top') b = Button(a, text='Ok', command=a.destroy) b.pack(side='bottom') ###################################################################### # Create demo in root window for testing. if __name__ == '__main__': location = '\\My Documents' filename = None root = Tk() Pmw.initialise(root) root.title(title) width=240; height=300; x=0; y=0 geometry = "%sx%s+%s+%s" %(width,height,x,y) root.geometry(geometry) ''' exitButton = Button(root, text = 'Exit', command = root.destroy) exitButton.pack(side = 'bottom') a = Button(root, text = 'About', command = about()) a.pack(side = 'left') ''' widget = Editor(root, location, filename) root.mainloop() From stewart.midwinter at gmail.com Sun Jan 9 01:01:53 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sun Jan 9 01:01:57 2005 Subject: [PythonCE] Re: PythonCE Digest, Vol 18, Issue 7 In-Reply-To: <20050108214725.B1D6B1E4010@bag.python.org> References: <20050108214725.B1D6B1E4010@bag.python.org> Message-ID: > From: anne.wangnick@t-online.de (Anne Wangnick) > Subject: AW: [PythonCE] Support for VGA PDA's > attached python.exe as of Python-2.3.4-arm-PPC2003.zip from > http://fore.validus.com/~kashtan/, modified (special resource HI_RES_AWARE > introduced as described on http://wiki.tcl.tk/10103) to support full VGA > resolution. err, thanks, Sebastian! that works great on my VGA screen. By including your earlier posting on this topic, you're also providing a gentle reminder to RTFM, or the list archives, as the case may be. thanks, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From stewart.midwinter at gmail.com Sun Jan 9 02:47:51 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sun Jan 9 02:48:01 2005 Subject: [PythonCE] Re: =?utf-8?q?=C2=BFPythonCe?= is functional? References: <41A7074E00013044@resmta03.ono.com> Message-ID: Looks like no one else answered this so I'll take a shot at it... Lord_ZealoN ono.com> writes: > I would like to develop an email application. I'm thinking in use python. > PythonCe is totally functional? well, most of the widgets seem to work, also Pmw and I suspect bwidgets would as well. But if you have some particular module you want to use, you can use the command-line interpreter and write some simple tests to see if what you want to do is feasible. > Whath bbdd can i use? sqlite only? I see that kirbybase is also mentioned on the list. But what's wrong with sqlite? seems simple to use, and fast, to me. > What are the limits of pythonce? dunno! > Is pythonce slow? compared to what? cheers, s From isrgish at fastem.com Sun Jan 9 13:40:10 2005 From: isrgish at fastem.com (Isr Gish) Date: Sun Jan 9 13:40:31 2005 Subject: [PythonCE] Re: Newbie questions Message-ID: <20050109124029.E3DF61E4008@bag.python.org> Brad Clements wrote: @murkworks.com> >There was also a PSPC (Palm Size PC) which runs Palm OS (like the Philips >Nino) The PSPC was also one of the WinCE devices (for example Casio E-100). I think the palm devices where just call palms without any added names. >> - Is there any other free cross-development tool for my handheld >> (I'm specially interested in C/C++ cross-compilers). > >http://msdn.microsoft.com has a whole section devoted to "Windows Mobile" >and "Windows Embedded" Development tools, including free downloads of the >embedded C++ tools and SDKs for various platforms. All of these tools run >on Windows, of course. They also include emulators.. There is a port of gcc 3.3.3 that works on the device itself. You can get it at: http://mamaich.kasone.com/fr_pocket.htm Another c- c++ compiler at: http://mifki.ru/pcsharp/index.html The first one I think is better. At this url there should also be a compiler for C#. All the best Isr From isrgish at fastem.com Sun Jan 9 13:40:54 2005 From: isrgish at fastem.com (Isr Gish) Date: Sun Jan 9 14:07:54 2005 Subject: [PythonCE] More Idle distractions Message-ID: <20050109130752.D4B021E4008@bag.python.org> Hi Ed, I realy love this program. Thanks for adding the save option on exit. I just want to drop you 2 things. 1) when I double click in the editor it automaticaly pastes the contents from the clip board. 2) A lot of times when I try selecting the begining of a line I get instead the sizing of the form itself. All te best Isr From lordzealon at ono.com Mon Jan 10 13:07:39 2005 From: lordzealon at ono.com (Lord_ZealoN) Date: Mon Jan 10 13:16:10 2005 Subject: [PythonCE] Re: ?PythonCe is functional? Message-ID: <1105358859.19894.6.camel@localhost.localdomain> First, thanks for your answers. > Looks like no one else answered this so I'll take a shot at it... > > Lord_ZealoN ono.com> writes: > > > I would like to develop an email application. I'm thinking in use > python. > > PythonCe is totally functional? > > well, most of the widgets seem to work, also Pmw and I suspect > bwidgets would as > well. But if you have some particular module you want to use, you can > use the > command-line interpreter and write some simple tests to see if what > you want to > do is feasible. > > > Whath bbdd can i use? sqlite only? > > I see that kirbybase is also mentioned on the list. But what's wrong > with > sqlite? seems simple to use, and fast, to me. The problem, i think, is that sqlite is a single user bbdd and i think this is a problem with big applications. No? > > > What are the limits of pythonce? > > dunno! dunno = ?I don't know? Sorry, but my english is very bad. > > > Is pythonce slow? > > compared to what? > Compared with C#.NET for example. Greetings. From bkc at murkworks.com Mon Jan 10 15:23:07 2005 From: bkc at murkworks.com (Brad Clements) Date: Mon Jan 10 15:03:46 2005 Subject: [PythonCE] Non-english PPC device users on this list? Message-ID: <41E244DF.15610.8B13342D@coal.murkworks.com> Can someone confirm that non-english version of PPC devices use language specific names for \Program Files or \Storage Card\Program Files? I'm working on the python code that figures out sys.path and where to dynamically load python23.dll from, and I think this is an long standing bug that we hard-code "\Program Files" which doesn't work on non-english devices. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From anne.wangnick at t-online.de Mon Jan 10 20:02:55 2005 From: anne.wangnick at t-online.de (Anne Wangnick) Date: Mon Jan 10 20:03:16 2005 Subject: AW: [PythonCE] Non-english PPC device users on this list? In-Reply-To: <41E244DF.15610.8B13342D@coal.murkworks.com> Message-ID: Yep, confirmed. On my german version of Microsoft PPC the location is "\Programme", and "\Storage Card" is called "\CF-Card" on my device. Also, it comes with a built-in flash storage area in "\LOOXstore". This is what is available in the registry regarding the directory names on my PDA: [HKEY_LOCAL_MACHINE\Explorer\Shell Folders] "Application Data"="\\Anwendungsdaten" "Desktop"="\\Windows\\Desktop" "Favorites"="\\Windows\\Favoriten" "Fonts"="\\Windows\\Schriftarten" "My Documents"="\\My Documents" "Program Files"="\\Programme" "Programs"="\\Windows\\Programme" "Recent"="\\Windows\\Zuletzt verwendete Dateien" "StartUp"="\\Windows\\Autostart" "Windows"="\\Windows" "Templates"="\\My Documents\\Vorlagen" [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\FlshDrv] "FolderName"="LOOXstore" [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Mass_Storage_Class\2] "DLL"="USBDISK6.DLL" "Prefix"="DSK" "Folder"="USB Disk" "IOCTL"=dword:00000004 "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Mass_Storage_Class\6] "UnitAttnRepeat"=dword:0000000a "ScsiCommandTimeout"=dword:00001388 "WriteSectorTimeout"=dword:00002710 "ReadSectorTimeout"=dword:00002710 "MediaPollInterval"=dword:000004e2 "DLL"="USBDISK6.DLL" "Prefix"="DSK" "Folder"="USB Disk" "IOCTL"=dword:00000004 "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles] "Folder"="Bereitgestellte Datentrager" "AutoMount"=dword:00000001 "AutoPart"=dword:00000000 "AutoFormat"=dword:00000000 "MountFlags"=dword:00000000 "DefaultFileSystem"="" "PartitionDriver"="mspart.dll" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\CDProfile] "Folder"="CD-ROM-Laufwerk" "Name"="IDE CDROM/DVD Drive" "DefaultFileSystem"="UDFS" "PartitionDriver"="" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\CDProfile\PartitionTable] [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile] "Folder"="Festplatte" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MMC] "Name"="MMC Card" "Folder"="SD-MMCard" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\PCMCIA] "Folder"="CF-Card" "Name"="PCMCIA/Compact Flash Device" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory] "Name"="SD Memory Card" "Folder"="SD-MMCard" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMMC] "Folder"="Speicherkarte" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\USBCDProfile] "Name"="USB CDROM/DVD Drive" "Folder"="CD-ROM-Laufwerk" "DefaultFileSystem"="UDFS" "PartitionDriver"="" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\USBCDProfile\PartitionTab le] [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\USBFDProfile] "Name"="USB Floppy Disk Drive" "Folder"="Diskettenlaufwerk" "DefaultFileSystem"="FATFS" "PartitionDriver"="" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\USBHDProfile] "Name"="USB Hard Disk Drive" "Folder"="Festplatte" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\USBHDProfile\FATFS] "EnableCacheWarm"=dword:00000000 Regards, Sebastian -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von Brad Clements Gesendet: Montag, 10. Januar 2005 15:23 An: pythonce@python.org Betreff: [PythonCE] Non-english PPC device users on this list? Can someone confirm that non-english version of PPC devices use language specific names for \Program Files or \Storage Card\Program Files? I'm working on the python code that figures out sys.path and where to dynamically load python23.dll from, and I think this is an long standing bug that we hard-code "\Program Files" which doesn't work on non-english devices. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements _______________________________________________ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce From chrbaumgaertel at gmx.de Mon Jan 10 23:17:00 2005 From: chrbaumgaertel at gmx.de (=?iso-8859-1?Q?Christian_Baumg=E4rtel?=) Date: Mon Jan 10 23:11:55 2005 Subject: [PythonCE] Non-english PPC device users on this list? References: <41E244DF.15610.8B13342D@coal.murkworks.com> Message-ID: <001401c4f762$1bb32f00$0301a8c0@home> Obtaining the "Program Files"-Folder: I think the standard way to get it, is to use the windows API function SHGetSpecialFolderPath() with nFolder = CSIDL_PROGRAM_FILES, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceshellui5 /html/wce50lrfSHGetSpecialFolderPath.asp ATTENTION: In in earlier documentation, (for WinCE3.0) I read, that the operating system returns FALSE, even if this function succeeds. I have not tried this function on WinCE, but use it on standard windows systems. Regards, Christian ----- Original Message ----- From: "Brad Clements" To: Sent: Monday, January 10, 2005 3:23 PM Subject: [PythonCE] Non-english PPC device users on this list? > Can someone confirm that non-english version of PPC devices use language specific > names for \Program Files or \Storage Card\Program Files? > > I'm working on the python code that figures out sys.path and where to dynamically load > python23.dll from, and I think this is an long standing bug that we hard-code "\Program > Files" which doesn't work on non-english devices. > > > > -- > Brad Clements, bkc@murkworks.com (315)268-1000 > http://www.murkworks.com (315)268-9812 Fax > http://www.wecanstopspam.org/ AOL-IM: BKClements > > _______________________________________________ > PythonCE mailing list > PythonCE@python.org > http://mail.python.org/mailman/listinfo/pythonce > From stewart.midwinter at gmail.com Tue Jan 11 17:22:26 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Tue Jan 11 17:22:28 2005 Subject: [PythonCE] Cannot load wxpyce dll due to insufficient memory Message-ID: I've installed wxpyce on a Toshiba e830 running Windows Mobile 2003 SE. It's presently got 16MB free for programs, and 16 MB free for storage. When I try to run the sample.py app, I get a message saying that the .dll file could not load due to insufficient memory. What would be the solution to this problem? thanks, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From jdavis at wgen.net Tue Jan 11 20:12:46 2005 From: jdavis at wgen.net (Jesse Davis) Date: Tue Jan 11 20:12:54 2005 Subject: [PythonCE] Building PythonCE for Intel-based PPC? Message-ID: I have a Dell Axim, which runs off the Intel PXA270 processor. I downloaded the source tree off SourceForge. Now -- how do I build it? I have MS eMbedded Visual C++, & I see there's a project file for it ( PCBuild\WinCE\python.vcp ). So here's the PROBLEM: when I do "Add Project Configuration", my CPU choices are WCE ARM and WCE x86. Neither of these will work for my unit, will they? How do I add more CPUs to eMbedded VC++'s list of options? Thanks, J. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20050111/6a5c9d16/attachment.html From bkc at murkworks.com Tue Jan 11 20:41:12 2005 From: bkc at murkworks.com (Brad Clements) Date: Tue Jan 11 20:21:45 2005 Subject: [PythonCE] Building PythonCE for Intel-based PPC? In-Reply-To: Message-ID: <41E3E0E5.11560.915CC795@coal.murkworks.com> On 11 Jan 2005 at 14:12, Jesse Davis wrote: > > I have a Dell Axim, which runs off the Intel PXA270 processor. I downloaded > the source tree off SourceForge. Now -- how do I build it? I have MS > eMbedded Visual C++, & I see there's a project file for it ( > PCBuild\WinCE\python.vcp ). So here's the PROBLEM: when I do "Add Project > Configuration", my CPU choices are WCE ARM and WCE x86. Neither of these > will work for my unit, will they? How do I add more CPUs to eMbedded VC++'s > list of options? Thanks, J. That python.vcp file is incomplete, it just allows a debuggable python.exe to be made, not the full python23.dll Anyway, I think what you want to do is run the wcearm.bat file to setup your environment, then nmake CFG=ARMREL That should be it. -- I am currently workingon David Kashtan's stuff for WCE300 (Straight Pocket PC), and I'll be exposing the modified source via an anonymous subversion repository. When I'm happy with all the tweaks, my intention is to merge all the WINCE changes into the Python 2.4 source tree. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From bkc at murkworks.com Tue Jan 11 20:41:30 2005 From: bkc at murkworks.com (Brad Clements) Date: Tue Jan 11 20:22:14 2005 Subject: [PythonCE] Building PythonCE for Intel-based PPC? In-Reply-To: Message-ID: <41E3E0F8.18788.915D0FA4@coal.murkworks.com> On 11 Jan 2005 at 14:12, Jesse Davis wrote: > > I have a Dell Axim, which runs off the Intel PXA270 processor. I downloaded > the source tree off SourceForge. Now -- how do I build it? I have MS > eMbedded Visual C++, & I see there's a project file for it ( > PCBuild\WinCE\python.vcp ). So here's the PROBLEM: when I do "Add Project > Configuration", my CPU choices are WCE ARM and WCE x86. Neither of these > will work for my unit, will they? How do I add more CPUs to eMbedded VC++'s > list of options? Thanks, J. Oh, I failed to mention that PXA270 is an ARM processor. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From bkc at murkworks.com Tue Jan 11 20:43:02 2005 From: bkc at murkworks.com (Brad Clements) Date: Tue Jan 11 20:23:43 2005 Subject: [PythonCE] Cannot load wxpyce dll due to insufficient memory In-Reply-To: Message-ID: <41E3E154.9847.915E77CE@coal.murkworks.com> On 11 Jan 2005 at 9:22, Stewart Midwinter wrote: > I've installed wxpyce on a Toshiba e830 running Windows Mobile 2003 > SE. It's presently got 16MB free for programs, and 16 MB free for > storage. When I try to run the sample.py app, I get a message saying > that the .dll file could not load due to insufficient memory. > > What would be the solution to this problem? Well, if you reset your memory preferences so that you have 2 meg free for storage and 30 meg for programs. .What happens? Sometimes I think some other errors loading a DLL will get labelled as "out of memory" error, even when it's not an out of memory condition. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From bkc at murkworks.com Tue Jan 11 20:55:18 2005 From: bkc at murkworks.com (Brad Clements) Date: Tue Jan 11 20:36:10 2005 Subject: [PythonCE] Building PythonCE for Intel-based PPC? In-Reply-To: Message-ID: <41E3E434.16234.9169B395@coal.murkworks.com> On 11 Jan 2005 at 14:24, Jesse Davis wrote: > Thanks. So, how do I build the whole thing: python23.dll + python.exe? > Should I use eMbedded VC++ for this, or gcc under Cygwin, or mingw? (kept on list) I'm using the embedded VC++ 4.0 IDE, and the Pocket PC 2003 SDK, both free downloads from msdn.microsoft.com. Don't forget the service pack for EVC 4 Download the source from David Kashtan's website http://fore.validus.com/~kashtan/ Unzip.. Navigate to PCBuild/WINCE directory Check WCEARM.bat to be sure it points to the correct places you installed EVC and the SDK too. Run WCEARM.bat to setup the environment variables. then nmake CFG=ARMREL -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From stewart.midwinter at gmail.com Tue Jan 11 21:12:35 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Tue Jan 11 21:12:38 2005 Subject: [PythonCE] Cannot load wxpyce dll due to insufficient memory In-Reply-To: <41E3E154.9847.915E77CE@coal.murkworks.com> References: <41E3E154.9847.915E77CE@coal.murkworks.com> Message-ID: I just rechecked and I now have 20 MB free for programs. You'd think that would be enough! When I shift the slider over so that more space is allocated for programs, say 30 MB, I notice that after a few seconds the slider shifts back. There doesn't seem to be a way for the user to set this manually and have it stick. Be that as it may, your other comment was most helpful: On Tue, 11 Jan 2005 14:43:02 -0500, Brad Clements wrote: > Sometimes I think some other errors loading a DLL will get labelled as "out of memory" > error, even when it's not an out of memory condition. In the sample.py app, I commented out the "import traceback" line, and the app worked! Good to know that wxPython can be used on this platform. I was also able to run the colourchooser.py app, though it was designed for a larger screen size. However, clearly more work is needed with the wxpyce package. Many other apps would not work unless I inserted a sys.path.append('\\Program Files\\python\\lib') so they could find the wx folder. Some apps, like the analogclocks.py, appear to have bugs in them and don't run properly, at least on my device. Getting Tkinter apps to run seems a lot less problematic, by comparison. cheers, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From stewart.midwinter at gmail.com Wed Jan 12 02:34:54 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Wed Jan 12 02:35:01 2005 Subject: [PythonCE] wx demo on PPC Message-ID: well, FWIW, here's the sample.py app running on a VGA screen PocketPC. Screen capture courtesy of the freeware cheers, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: wxsample.png Type: image/png Size: 10986 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20050111/7e26d8ce/wxsample-0001.png From isrgish at fastem.com Wed Jan 12 11:48:03 2005 From: isrgish at fastem.com (Isr Gish) Date: Wed Jan 12 11:49:43 2005 Subject: [PythonCE] Cannot load wxpyce dll due to insufficient memory Message-ID: <20050112104941.E8DB51E4005@bag.python.org> Stewart Midwinter wrote: >When I shift the slider over so that more space is allocated for >programs, say 30 MB, I notice that after a few seconds the slider >shifts back. There doesn't seem to be a way for the user to set this >manually and have it stick. You cant move the slider all the way. But you can move it to a certain extent. How much depends i find that sometimes i have to leave 10 MB and sometimes only 5-6 MB. Play around till you get it. All the best, Isr From danny at orionrobots.co.uk Wed Jan 12 11:58:37 2005 From: danny at orionrobots.co.uk (Danny Staple) Date: Wed Jan 12 11:53:15 2005 Subject: [PythonCE] Cannot load wxpyce dll due to insufficient memory In-Reply-To: References: <41E3E154.9847.915E77CE@coal.murkworks.com> Message-ID: <34329.132.185.240.121.1105527517.squirrel@132.185.240.121> I have been seing the exact same problem when I import any modules from wxPython. I have 16-19mb program memory free normally (with 32-34mb alllocated for programs). I was trying to import from wx using the interactive python shell. Any thoughts? My pocket PC has an addition 64Mb of "Internal storage" which basically works like a memory card. Is there any way I can move windows components over there and shortcut to it or something? Orion -- OrionRobots.co.uk - Robots from Sol to Sirius. On Tue, January 11, 2005 8:12 pm, Stewart Midwinter said: > I just rechecked and I now have 20 MB free for programs. You'd think > that would be enough! > > When I shift the slider over so that more space is allocated for > programs, say 30 MB, I notice that after a few seconds the slider > shifts back. There doesn't seem to be a way for the user to set this > manually and have it stick. > > Be that as it may, your other comment was most helpful: > > On Tue, 11 Jan 2005 14:43:02 -0500, Brad Clements > wrote: >> Sometimes I think some other errors loading a DLL will get labelled as >> "out of memory" >> error, even when it's not an out of memory condition. > > In the sample.py app, I commented out the "import traceback" line, and > the app worked! Good to know that wxPython can be used on this > platform. > > I was also able to run the colourchooser.py app, though it was > designed for a larger screen size. However, clearly more work is > needed with the wxpyce package. > > Many other apps would not work unless I inserted a > sys.path.append('\\Program Files\\python\\lib') so they could find the > wx folder. Some apps, like the analogclocks.py, appear to have bugs in > them and don't run properly, at least on my device. > > Getting Tkinter apps to run seems a lot less problematic, by comparison. > > cheers, > -- > Stewart Midwinter > stewart@midwinter.ca > stewart.midwinter@gmail.com From stewart.midwinter at gmail.com Wed Jan 12 15:52:21 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Wed Jan 12 15:52:23 2005 Subject: [PythonCE] Cannot load wxpyce dll due to insufficient memory In-Reply-To: <34329.132.185.240.121.1105527517.squirrel@132.185.240.121> References: <41E3E154.9847.915E77CE@coal.murkworks.com> <34329.132.185.240.121.1105527517.squirrel@132.185.240.121> Message-ID: On the desktop, I put my Pmw megawidgets in a completely separate location from the rest of my Python stuff, and I am able to import them easily. All I do is add that location to the path, like so: import sys sys.path[:0] = ["c:\\programs"] import Pmw Using this same approach on the PocketPC with an SD Card I might try: sys.path[:0] = ['\\Program Files\\python\\lib'] import Tkinter sys.path[:0] = ['\\Flash Rom Disk'] import some_package cheers S On Wed, 12 Jan 2005 10:58:37 -0000 (GMT), Danny Staple wrote: > My pocket PC has an addition 64Mb of "Internal storage" which basically > works like a memory card. Is there any way I can move windows components > over there and shortcut to it or something? -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From geir.egeland at gmail.com Thu Jan 13 10:04:55 2005 From: geir.egeland at gmail.com (Geir Egeland) Date: Thu Jan 13 10:04:13 2005 Subject: [PythonCE] launch external application from pythonCE Message-ID: <41E639B7.1060906@gmail.com> Hi, How can I launch Internet Explorer from a python program ? regards, geir From stewart.midwinter at gmail.com Thu Jan 13 18:26:53 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Thu Jan 13 18:26:56 2005 Subject: [PythonCE] launch external application from pythonCE In-Reply-To: <41E639B7.1060906@gmail.com> References: <41E639B7.1060906@gmail.com> Message-ID: Darn, I forgot my PDA at home so I can try this out. My suggestion would be to see if os.system() is available, and use that. If Pocket Internet Explorer's file name is iexplore.exe, do something like the following #import sys, os sys.path.append('\\Program Files\\Python\\Lib') cmd = "iexplore.exe http://www.cbc.ca" os.system(cmd) Note that your Python app is still running, but unable to do anything else, while iexplore is running, if you use this approach. To unlock the Python app, use a different approach, like execv or popen or its variants. Let us know if this works! cheers S On Thu, 13 Jan 2005 10:04:55 +0100, Geir Egeland wrote: > Hi, > How can I launch Internet Explorer from a python program ? -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From kitsune_e at yahoo.com Thu Jan 13 21:08:14 2005 From: kitsune_e at yahoo.com (Ed Blake) Date: Thu Jan 13 21:08:18 2005 Subject: [PythonCE] launch external application from pythonCE In-Reply-To: Message-ID: <20050113200815.29565.qmail@web50210.mail.yahoo.com> Also you may need to specify the path to the target application as WinCE has no concept of an environment. --- Stewart Midwinter wrote: > Darn, I forgot my PDA at home so I can try this out. My suggestion > would be to see if os.system() is available, and use that. If Pocket > Internet Explorer's file name is iexplore.exe, do something like the > following > > #import sys, os > sys.path.append('\\Program Files\\Python\\Lib') > cmd = "iexplore.exe http://www.cbc.ca" > os.system(cmd) > > Note that your Python app is still running, but unable to do anything > else, while iexplore is running, if you use this approach. To unlock > the Python app, use a different approach, like execv or popen or its > variants. > > Let us know if this works! > > cheers > S > > > > On Thu, 13 Jan 2005 10:04:55 +0100, Geir Egeland > wrote: > > Hi, > > How can I launch Internet Explorer from a python program ? > > -- > Stewart Midwinter > stewart@midwinter.ca > stewart.midwinter@gmail.com > _______________________________________________ > PythonCE mailing list > PythonCE@python.org > http://mail.python.org/mailman/listinfo/pythonce > From geir.egeland at gmail.com Fri Jan 14 13:25:23 2005 From: geir.egeland at gmail.com (Geir Egeland) Date: Fri Jan 14 13:24:58 2005 Subject: [PythonCE] launch external application from pythonCE In-Reply-To: <20050113200815.29565.qmail@web50210.mail.yahoo.com> References: <20050113200815.29565.qmail@web50210.mail.yahoo.com> Message-ID: <41E7BA33.7070504@gmail.com> Hi, The error message i get using os.system(cmd) is : AttributeError: 'module' object has no attribute 'system' So, this doesn't seem to work... Doing a help(os) does not show the 'system' command under available functions. Any other suggestions? regards, geir egeland Ed Blake wrote: >Also you may need to specify the path to the target application as WinCE has >no concept of an environment. > >--- Stewart Midwinter wrote: > > > >>Darn, I forgot my PDA at home so I can try this out. My suggestion >>would be to see if os.system() is available, and use that. If Pocket >>Internet Explorer's file name is iexplore.exe, do something like the >>following >> >>#import sys, os >>sys.path.append('\\Program Files\\Python\\Lib') >>cmd = "iexplore.exe http://www.cbc.ca" >>os.system(cmd) >> >>Note that your Python app is still running, but unable to do anything >>else, while iexplore is running, if you use this approach. To unlock >>the Python app, use a different approach, like execv or popen or its >>variants. >> >>Let us know if this works! >> >>cheers >>S >> >> >> >>On Thu, 13 Jan 2005 10:04:55 +0100, Geir Egeland >>wrote: >> >> >>>Hi, >>>How can I launch Internet Explorer from a python program ? >>> >>> >>-- >>Stewart Midwinter >>stewart@midwinter.ca >>stewart.midwinter@gmail.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 > > > From mike at pcblokes.com Fri Jan 14 13:30:13 2005 From: mike at pcblokes.com (Michael Foord) Date: Fri Jan 14 13:30:20 2005 Subject: [PythonCE] launch external application from pythonCE In-Reply-To: <41E7BA33.7070504@gmail.com> References: <20050113200815.29565.qmail@web50210.mail.yahoo.com> <41E7BA33.7070504@gmail.com> Message-ID: <41E7BB55.9000304@pcblokes.com> Geir Egeland wrote: > Hi, > The error message i get using os.system(cmd) is : > > AttributeError: 'module' object has no attribute 'system' > > So, this doesn't seem to work... > Doing a help(os) does not show the 'system' command under available > functions. > Any other suggestions? Some of the exec* options are available. Try those. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml > > regards, > geir egeland > > Ed Blake wrote: > >> Also you may need to specify the path to the target application as >> WinCE has >> no concept of an environment. >> >> --- Stewart Midwinter wrote: >> >> >> >>> Darn, I forgot my PDA at home so I can try this out. My suggestion >>> would be to see if os.system() is available, and use that. If Pocket >>> Internet Explorer's file name is iexplore.exe, do something like the >>> following >>> >>> #import sys, os >>> sys.path.append('\\Program Files\\Python\\Lib') >>> cmd = "iexplore.exe http://www.cbc.ca" >>> os.system(cmd) >>> >>> Note that your Python app is still running, but unable to do anything >>> else, while iexplore is running, if you use this approach. To unlock >>> the Python app, use a different approach, like execv or popen or its >>> variants. >>> >>> Let us know if this works! >>> >>> cheers >>> S >>> >>> >>> >>> On Thu, 13 Jan 2005 10:04:55 +0100, Geir Egeland >>> >>> wrote: >>> >>> >>>> Hi, >>>> How can I launch Internet Explorer from a python program ? >>>> >>> >>> -- >>> Stewart Midwinter >>> stewart@midwinter.ca >>> stewart.midwinter@gmail.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 >> >> >> > > _______________________________________________ > PythonCE mailing list > PythonCE@python.org > http://mail.python.org/mailman/listinfo/pythonce > > > From bkc at murkworks.com Fri Jan 14 16:02:16 2005 From: bkc at murkworks.com (Brad Clements) Date: Fri Jan 14 15:42:36 2005 Subject: [PythonCE] launch external application from pythonCE In-Reply-To: <41E7BA33.7070504@gmail.com> References: <20050113200815.29565.qmail@web50210.mail.yahoo.com> Message-ID: <41E793F8.4712.9FD08517@coal.murkworks.com> On 14 Jan 2005 at 13:25, Geir Egeland wrote: > So, this doesn't seem to work... > Doing a help(os) does not show the 'system' command under available > functions. > Any other suggestions? I don't think system exists on windows CE. Hmm, even the 4.20 .NET reference doesn't show _exec or _spawn as being supported in libc. You'll have to use CreateProcess() from win32api I suppose. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From stewart.midwinter at gmail.com Fri Jan 14 22:56:13 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Fri Jan 14 22:56:16 2005 Subject: [PythonCE] launch external application from pythonCE In-Reply-To: <41E793F8.4712.9FD08517@coal.murkworks.com> References: <20050113200815.29565.qmail@web50210.mail.yahoo.com> <41E7BA33.7070504@gmail.com> <41E793F8.4712.9FD08517@coal.murkworks.com> Message-ID: PythonCE supports execvp, but when I try: os.execvp('\\Windows\\iexplore.exe',('',)) I get the following traceback error from binaries\os.py: "cannot import name ENOTDIR" maybe this can be worked around? s On Fri, 14 Jan 2005 10:02:16 -0500, Brad Clements wrote: > On 14 Jan 2005 at 13:25, Geir Egeland wrote: > > > So, this doesn't seem to work... > > Doing a help(os) does not show the 'system' command under available > > functions. > > Any other suggestions? > > > I don't think system exists on windows CE. > > Hmm, even the 4.20 .NET reference doesn't show _exec or _spawn as being > supported in libc. > > You'll have to use CreateProcess() from win32api I suppose. > > -- > Brad Clements, bkc@murkworks.com (315)268-1000 > http://www.murkworks.com (315)268-9812 Fax > http://www.wecanstopspam.org/ AOL-IM: BKClements > > _______________________________________________ > PythonCE mailing list > PythonCE@python.org > http://mail.python.org/mailman/listinfo/pythonce > -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From isrgish at fastem.com Sun Jan 16 07:31:22 2005 From: isrgish at fastem.com (Isr Gish) Date: Sun Jan 16 07:31:40 2005 Subject: [PythonCE] launch external application from pythonCE Message-ID: <20050116063139.110671E4008@bag.python.org> There is a module osce.py floating around that emulates the system functions. It was created by Telion. All the best, Isr -----Original Message----- >From: "Brad Clements" >Sent: 1/14/05 10:02:16 AM >To: "Geir Egeland", "pythonce@python.org" >Subject: Re: [PythonCE] launch external application from pythonCE >On 14 Jan 2005 at 13:25, Geir Egeland wrote: > >> So, this doesn't seem to work... >> Doing a help(os) does not show the 'system' command under available >> functions. >> Any other suggestions? > > >I don't think system exists on windows CE. > >Hmm, even the 4.20 .NET reference doesn't show _exec or _spawn as being >supported in libc. > >You'll have to use CreateProcess() from win32api I suppose. > > > > >-- >Brad Clements, bkc@murkworks.com (315)268-1000 >http://www.murkworks.com (315)268-9812 Fax >http://www.wecanstopspam.org/ AOL-IM: BKClements > >_______________________________________________ >PythonCE mailing list >PythonCE@python.org >http://mail.python.org/mailman/listinfo/pythonce > From mike at pcblokes.com Mon Jan 17 12:13:30 2005 From: mike at pcblokes.com (Michael Foord) Date: Mon Jan 17 12:13:35 2005 Subject: [PythonCE] osce.py In-Reply-To: <20050116063139.110671E4008@bag.python.org> References: <20050116063139.110671E4008@bag.python.org> Message-ID: <41EB9DDA.4060407@pcblokes.com> I found an archived email with osce.py at : http://mail.python.org/pipermail/pythonce/2002-October/000246.html I used the base64 encoding to extract the plaintext of the attachment. I haven't tested to see if it works - looks interesting though. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml Isr Gish wrote: >There is a module osce.py floating around that emulates the system functions. >It was created by Telion. > >All the best, >Isr > >-----Original Message----- > >From: "Brad Clements" > >Sent: 1/14/05 10:02:16 AM > >To: "Geir Egeland", "pythonce@python.org" > >Subject: Re: [PythonCE] launch external application from pythonCE > >On 14 Jan 2005 at 13:25, Geir Egeland wrote: > > > >> So, this doesn't seem to work... > >> Doing a help(os) does not show the 'system' command under available > >> functions. > >> Any other suggestions? > > > > > >I don't think system exists on windows CE. > > > >Hmm, even the 4.20 .NET reference doesn't show _exec or _spawn as being > >supported in libc. > > > >You'll have to use CreateProcess() from win32api I suppose. > > > > > > > > > >-- > >Brad Clements, bkc@murkworks.com (315)268-1000 > >http://www.murkworks.com (315)268-9812 Fax > >http://www.wecanstopspam.org/ 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 > > > > > -------------- next part -------------- # Module osce.py # This file is read and integrated by os.py # Call these funcs from os # # Telion # CE patch for execv etc.. #import win32process #import string #import win32event def execv (path, args): import os if not type(args) in (tuple, list): raise TypeError, "execv() arg 2 must be a tuple or list" p=os.path.abspath(path) #if os.path.exists(p): import win32process import string hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,string.join(args,' '),None,None,0,0,None,None,None) #del string #del win32process #del os def execve (path, args, env): # Currently, env is simply ignored. Sorry if you were trying to use that. import os if not type(args) in (tuple, list): raise TypeError, "execve() arg 2 must be a tuple or list" p=os.path.abspath(path) import win32process import string hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,string.join(args,' '),None,None,0,0,env,None,None) #del string #del win32process #del os def system(cmd): # This function will not start program in the directory with space(s) # It is the same for other Windows version of Python. # I made os.sytema(cmd, arg) for your convenience. # Note: the retrun value maybe unliable... import win32process import string import os import win32event #import re a = string.find(cmd, ' ') arg = '' if a >0: p=cmd[:a] arg = cmd[a+1:] else: p=cmd p=os.path.abspath(p) hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,arg,None,None,0,0,None,None,None) if hPro and hThr: win32event.WaitForSingleObject(hPro,win32event.INFINITE) r = win32process.GetExitCodeProcess(hPro) # This returns always 0? #r2 = win32process.GetExitCodeThread(hThr) #del re #del string #del win32process #del win32event #del os return r def systema(cmd,arg): # This function is for CE only... # import win32process import string import os import win32event #import re p=os.path.abspath(cmd) hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,arg,None,None,0,0,None,None,None) if hPro and hThr: win32event.WaitForSingleObject(hPro,win32event.INFINITE) r = win32process.GetExitCodeProcess(hPro) #del re #del string #del win32process #del win32event #del os return r def syscmd(icmd, wait=0): # call up a command through CMD.EXE and let it stay open after executeion # Python does not wait for the command uness "wait" is True. import win32process import win32event hPro,hThr,dwPro,dwThr=win32process.CreateProcess('\\windows\\cmd','/k '+icmd,None,None,0,0,None,None,None) if wait and hPro and hThr: win32event.WaitForSingleObject(hPro,win32event.INFINITE) #del win32event #del win32process def syscmdc(icmd, wait=0): # call up a command through CMD.EXE and close it after return # Python does not wait for the command uness "wait" is True. import win32process import win32event hPro,hThr,dwPro,dwThr=win32process.CreateProcess('\\windows\\cmd','/c '+icmd,None,None,0,0,None,None,None) if wait and hPro and hThr: win32event.WaitForSingleObject(hPro,win32event.INFINITE) #del win32event #del win32process From mike at pcblokes.com Mon Jan 17 12:17:25 2005 From: mike at pcblokes.com (Michael Foord) Date: Mon Jan 17 12:17:30 2005 Subject: [PythonCE] osce.py In-Reply-To: <41EB9DDA.4060407@pcblokes.com> References: <20050116063139.110671E4008@bag.python.org> <41EB9DDA.4060407@pcblokes.com> Message-ID: <41EB9EC5.6020300@pcblokes.com> Michael Foord wrote: > I found an archived email with osce.py at : > http://mail.python.org/pipermail/pythonce/2002-October/000246.html Please ignore the proxy url here - you won't be able to use it anyway. The proper address is just : http://mail.python.org/pipermail/pythonce/2002-October/000246.html This contains examples of how to use the module, so worth looking up. It is over 2 years old though... so caveat emptor. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml > > > > I used the base64 encoding to extract the plaintext of the attachment. > I haven't tested to see if it works - looks interesting though. > > Regards, > > Fuzzy > http://www.voidspace.org.uk/python/index.shtml > > Isr Gish wrote: > >> There is a module osce.py floating around that emulates the system >> functions. It was created by Telion. >> >> All the best, >> Isr >> >> -----Original Message----- >> >From: "Brad Clements" >> >Sent: 1/14/05 10:02:16 AM >> >To: "Geir Egeland", >> "pythonce@python.org" >> >Subject: Re: [PythonCE] launch external application from pythonCE >> >On 14 Jan 2005 at 13:25, Geir Egeland wrote: >> > >> >> So, this doesn't seem to work... >> >> Doing a help(os) does not show the 'system' command under >> available >> functions. >> >> Any other suggestions? >> > >> > >> >I don't think system exists on windows CE. >> > >> >Hmm, even the 4.20 .NET reference doesn't show _exec or _spawn as >> being >supported in libc. >> > >> >You'll have to use CreateProcess() from win32api I suppose. >> > >> > >> > >> > >> >-- >Brad Clements, bkc@murkworks.com (315)268-1000 >> >http://www.murkworks.com (315)268-9812 Fax >> >http://www.wecanstopspam.org/ 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 >> >> >> >> >> > >------------------------------------------------------------------------ > ># Module osce.py > ># This file is read and integrated by os.py > ># Call these funcs from os > ># > ># Telion > > > ># CE patch for execv etc.. > > > >#import win32process > >#import string > >#import win32event > > > >def execv (path, args): > > import os > > if not type(args) in (tuple, list): > > raise TypeError, "execv() arg 2 must be a tuple or list" > > p=os.path.abspath(path) > > #if os.path.exists(p): > > import win32process > > import string > > hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,string.join(args,' '),None,None,0,0,None,None,None) > > #del string > > #del win32process > > #del os > > > >def execve (path, args, env): > > # Currently, env is simply ignored. Sorry if you were trying to use that. > > import os > > if not type(args) in (tuple, list): > > raise TypeError, "execve() arg 2 must be a tuple or list" > > p=os.path.abspath(path) > > import win32process > > import string > > hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,string.join(args,' '),None,None,0,0,env,None,None) > > #del string > > #del win32process > > #del os > > > > > >def system(cmd): > > # This function will not start program in the directory with space(s) > > # It is the same for other Windows version of Python. > > # I made os.sytema(cmd, arg) for your convenience. > > # Note: the retrun value maybe unliable... > > > > import win32process > > import string > > import os > > import win32event > > #import re > > a = string.find(cmd, ' ') > > arg = '' > > if a >0: > > p=cmd[:a] > > arg = cmd[a+1:] > > else: > > p=cmd > > p=os.path.abspath(p) > > hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,arg,None,None,0,0,None,None,None) > > if hPro and hThr: > > win32event.WaitForSingleObject(hPro,win32event.INFINITE) > > r = win32process.GetExitCodeProcess(hPro) # This returns always 0? > > #r2 = win32process.GetExitCodeThread(hThr) > > #del re > > #del string > > #del win32process > > #del win32event > > #del os > > return r > > > >def systema(cmd,arg): > > # This function is for CE only... > > # > > import win32process > > import string > > import os > > import win32event > > #import re > > p=os.path.abspath(cmd) > > hPro,hThr,dwPro,dwThr=win32process.CreateProcess(p,arg,None,None,0,0,None,None,None) > > if hPro and hThr: > > win32event.WaitForSingleObject(hPro,win32event.INFINITE) > > r = win32process.GetExitCodeProcess(hPro) > > #del re > > #del string > > #del win32process > > #del win32event > > #del os > > return r > > > > > > > >def syscmd(icmd, wait=0): > > # call up a command through CMD.EXE and let it stay open after executeion > > # Python does not wait for the command uness "wait" is True. > > import win32process > > import win32event > > hPro,hThr,dwPro,dwThr=win32process.CreateProcess('\\windows\\cmd','/k '+icmd,None,None,0,0,None,None,None) > > if wait and hPro and hThr: > > win32event.WaitForSingleObject(hPro,win32event.INFINITE) > > #del win32event > > #del win32process > > > > > >def syscmdc(icmd, wait=0): > > # call up a command through CMD.EXE and close it after return > > # Python does not wait for the command uness "wait" is True. > > import win32process > > import win32event > > hPro,hThr,dwPro,dwThr=win32process.CreateProcess('\\windows\\cmd','/c '+icmd,None,None,0,0,None,None,None) > > if wait and hPro and hThr: > > win32event.WaitForSingleObject(hPro,win32event.INFINITE) > > #del win32event > > #del win32process > > > > > >------------------------------------------------------------------------ > >_______________________________________________ >PythonCE mailing list >PythonCE@python.org >http://mail.python.org/mailman/listinfo/pythonce > > From kitsune_e at yahoo.com Mon Jan 17 18:24:41 2005 From: kitsune_e at yahoo.com (Ed Blake) Date: Mon Jan 17 18:24:44 2005 Subject: [PythonCE] OSCE links Message-ID: <20050117172441.37632.qmail@web50206.mail.yahoo.com> Telion's homepage: http://pages.ccapcable.com/lac/PythonCE.html Look toward the bottom of the page for "Extra .py files" it takes you to a directory listing. get the os.py and osce.py files (and anything else that looks interesting). From apech at front.ru Sat Jan 22 23:22:21 2005 From: apech at front.ru (Alexey Pechonkin) Date: Sat Jan 22 23:30:56 2005 Subject: [PythonCE] Re: Smartphone 2003 References: Message-ID: stuffduff cox.net> writes: > > I also need an interactive shell to provide a standard command line python > prompt. > I did a search on 'SipGetInfo' failed and found: > > http://www.murkworks.com/Research/Python/PythonCE/PythonCEWiki/uploads/pcces > hell.py.ppc_with_input.txt > > Has anybody tried it? How do I use it? > I've just commented out all references to SIP functions and it works OK on my MPx200. I set the dimensions of main shell window to CW_USEDEFAULT. I can't make left/right softbuttons work though, maybe due to lack of experience in WinCE programming. BTW, anyone knows where to get wxPython source for CE, I'd like to port it to Smartphone if nobody has done it till now. From james.burkert at gmail.com Sun Jan 23 08:00:18 2005 From: james.burkert at gmail.com (James Burkert) Date: Sun Jan 23 08:02:22 2005 Subject: [PythonCE] Twisted on PPC 2003 Message-ID: <42aeae22050122230025a675@mail.gmail.com> Hi everyone, I'm a little new to Python and to PythonCE in general, but hopefully I've got an easy question: Does anybody have a distribution of Twisted for PPC 2003? I tried looking in the existing list archive, but didn't have much luck. Failing an existing distribution, does anyone have a How To on wrapping/porting things like Twisted to Win CE? I'm looking to send data via TCP/IP to a particular port on my desktop with at least some security (ie SSL) , and it seems like Twisted should fit the bill. I've downloaded the source code for Twisted and gcc arm-elf 3.4.0 compiler. I don't actually see any C style .o, .c files or make files in the Twisted source code, any advice on how to get that working? Relevant Details: I'm using Python 2.3.4 on an iPAQ 2215, which looks like its working. Thanks for the help! J From kitsune_e at yahoo.com Mon Jan 24 19:03:27 2005 From: kitsune_e at yahoo.com (Ed Blake) Date: Mon Jan 24 19:03:31 2005 Subject: [PythonCE] IdleCE new version Message-ID: <20050124180327.51533.qmail@web50203.mail.yahoo.com> I've finally finished enough improvements to release another version. This version fixes a number of bugs related to the edit/popup menus and their commands. Also the addition of a button to execute the current script(!), better tab control (i.e. tab denotes a column of fixed width). There are still a number of improvements which still need to be made, and there are most likely new bugs to be found, but this is a much more usable release. For the script: http://kitsu.petesdomain.com/files/IdleCE.py For the outline: http://kitsu.petesdomain.com/files/IdleCE.leo A note about using tab/shift-tab for indent/dedent, I've done some experiments and found some interesting things about Tk's event handler on CE (PPC). Firstly if you are using the graffiti style input tab does *not* generate a keysym 'tab' as it should (actually the key code returned is 0...). Also when using the virtual keyboard pressing shift then tab does not produce a shift tab event, just a regular tab... So for now I suggest for indent and dedent you use the highlight and tap method. It is a slightly less efficient workflow, but at least it works... From james.burkert at gmail.com Tue Jan 25 01:26:47 2005 From: james.burkert at gmail.com (James Burkert) Date: Tue Jan 25 01:26:49 2005 Subject: [PythonCE] Re: Twisted on PPC 2003 In-Reply-To: <42aeae22050122230025a675@mail.gmail.com> References: <42aeae22050122230025a675@mail.gmail.com> Message-ID: <42aeae2205012416264b054e5d@mail.gmail.com> Howdy, I talked to a python guru where I work, and he gently pointed out that the "source" is really in python, so a) it doesn't need to be compiled per se, and b) I could just copy it over and probably get most or all the functionality I really want. Now time to see if I can get GTK/Glade... Thanks for your forbearance and not sending yet another newbie a nasty email! :) J On Sun, 23 Jan 2005 00:00:18 -0700, James Burkert wrote: > Hi everyone, > > I'm a little new to Python and to PythonCE in general, but hopefully > I've got an easy question: > > Does anybody have a distribution of Twisted for PPC 2003? > > I tried looking in the existing list archive, but didn't have much > luck. Failing an existing distribution, does anyone have a How To on > wrapping/porting things like Twisted to Win CE? > > I'm looking to send data via TCP/IP to a particular port on my desktop > with at least some security (ie SSL) , and it seems like Twisted > should fit the bill. > > I've downloaded the source code for Twisted and gcc arm-elf 3.4.0 > compiler. I don't actually see any C style .o, .c files or make files > in the Twisted source code, any advice on how to get that working? > > Relevant Details: I'm using Python 2.3.4 on an iPAQ 2215, which looks > like its working. > > Thanks for the help! > > J > -- ---------- James Burkert Systems Integration and Mission Operations Colorado Space Grant Consortium My Schedule: https://webcal.colorado.edu/command.shtml?calid=burkert&view=weekview From bkc at murkworks.com Tue Jan 25 01:48:39 2005 From: bkc at murkworks.com (Brad Clements) Date: Tue Jan 25 01:27:59 2005 Subject: [PythonCE] Re: Twisted on PPC 2003 In-Reply-To: <42aeae2205012416264b054e5d@mail.gmail.com> References: <42aeae22050122230025a675@mail.gmail.com> Message-ID: <41F54C33.5142.20DFCF9E@coal.murkworks.com> On 24 Jan 2005 at 17:26, James Burkert wrote: > I talked to a python guru where I work, and he gently pointed out that the > "source" is really in python, so a) it doesn't need to be compiled per se, > and b) I could just copy it over and probably get most or all the > functionality I really want. Twisted is huge. Are you sure you really need all of it? What are you really trying to do? -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From stewart.midwinter at gmail.com Tue Jan 25 01:40:46 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Tue Jan 25 01:40:48 2005 Subject: [PythonCE] Re: Twisted on PPC 2003 In-Reply-To: <42aeae2205012416264b054e5d@mail.gmail.com> References: <42aeae22050122230025a675@mail.gmail.com> <42aeae2205012416264b054e5d@mail.gmail.com> Message-ID: James, you may find it easiest to work with Tkinter on the PPC platform. wxpython requires more memory, and I haven't even heard of GTK or PyQt for PPC yet. (though I'd be glad to be corrected...). check http://tkinter.unpy.net/wiki for advice on getting it started. cheers S On Mon, 24 Jan 2005 17:26:47 -0700, James Burkert wrote: > Howdy, > > Now time to see if I can get GTK/Glade... -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From james.burkert at gmail.com Wed Jan 26 00:01:18 2005 From: james.burkert at gmail.com (James Burkert) Date: Wed Jan 26 00:01:27 2005 Subject: [PythonCE] Re: Re: Re: Twisted on PPC 2003 (Brad Clements) In-Reply-To: <20050125110036.B1F8A1E4013@bag.python.org> References: <20050125110036.B1F8A1E4013@bag.python.org> Message-ID: <42aeae2205012515013be063a@mail.gmail.com> Hi, I'm sure I don't really need ALL of twisted. For now I am just trying to send ASCII text from my PDA to an existing application to an arbitrary IP # and port # via bluetooth and WiFi. Bluetooth specifically because that's what I intend to use for testing, since I don't have a currently functioning WiF cardi, but the eventual application is intended for WiFi. Later, I'll create a desktop-side server, so I can do things like SSL, compression, and other app-specific features. I figured on using Twisted because its the first thing I found that looked like it had these things already built in, I really don't want to reinvent the wheel with my network code, and frankly I'm not that good a programmer anyway. I know the basic functionality for this exists in Twisted, because its being used on another platform I'm familiar with, running the same 400 MHz XScale processor, albeit with Linux rather than CE. I figure once my app is working, I can pare down Twisted and the other packages to a distributable form. Can you recommend something else that may work better? I'm definitely open to suggestions and ideas. Thanks, J PS. Thanks for the tip on Tkinter (how do you pronounce that anyway?) :) > > Twisted is huge. Are you sure you really need all of it? What are you really trying to do? > > -- > Brad Clements, bkc@murkworks.com (315)268-1000 > http://www.murkworks.com (315)268-9812 Fax > http://www.wecanstopspam.org/ AOL-IM: BKClements From bkc at murkworks.com Wed Jan 26 03:16:25 2005 From: bkc at murkworks.com (Brad Clements) Date: Wed Jan 26 02:55:52 2005 Subject: [PythonCE] Re: Re: Re: Twisted on PPC 2003 (Brad Clements) In-Reply-To: <42aeae2205012515013be063a@mail.gmail.com> References: <20050125110036.B1F8A1E4013@bag.python.org> Message-ID: <41F6B728.1294.A691E001@coal.murkworks.com> On 25 Jan 2005 at 16:01, James Burkert wrote: > I'm sure I don't really need ALL of twisted. For now I am just trying > to send ASCII text from my PDA to an existing application to an > arbitrary IP # and port # via bluetooth and WiFi. Bluetooth > specifically because that's what I intend to use for testing, since I > don't have a currently functioning WiF cardi, but the eventual > application is intended for WiFi. This phrasing implies that the PDA opens a connection to another server. Therefore the PDA is a client, and not really a server. So, you can just use socket calls for rwaw connectivity. If the other end is an http server, than you can use httplib. Twisted, while it has some client functionality, is principally a server framework. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements From stewart.midwinter at gmail.com Wed Jan 26 04:39:40 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Wed Jan 26 04:39:44 2005 Subject: [PythonCE] Re: Re: Re: Twisted on PPC 2003 (Brad Clements) In-Reply-To: <42aeae2205012515013be063a@mail.gmail.com> References: <20050125110036.B1F8A1E4013@bag.python.org> <42aeae2205012515013be063a@mail.gmail.com> Message-ID: On Tue, 25 Jan 2005 16:01:18 -0700, James Burkert wrote: > PS. Thanks for the tip on Tkinter (how do you pronounce that anyway?) :) it's T - K - Inter. Given your description of what you want to do, why not take a look at the code below (from the Python.org site at: http://docs.python.org/lib/socket-example.html ). Put the server code on your desktop, the client code on your PDA, get a network connection going with BT (and check it by running PIE and visiting an external website), then run the client code on the PDA. Here's the 2 pieces you'll need: --- # Echo server program import socket HOST = '' # Symbolic name meaning the local host PORT = 50007 # Arbitrary non-privileged port s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) s.listen(1) conn, addr = s.accept() print 'Connected by', addr while 1: data = conn.recv(1024) if not data: break conn.send(data) conn.close() # Echo client program import socket HOST = 'daring.cwi.nl' # The remote host PORT = 50007 # The same port as used by the server s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) s.send('Hello, world') data = s.recv(1024) s.close() print 'Received', repr(data) --- cheers -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From apech at front.ru Thu Jan 27 12:57:16 2005 From: apech at front.ru (Alexey Pechonkin) Date: Thu Jan 27 12:57:30 2005 Subject: [PythonCE] wxPythonCE sources Message-ID: Hello all! Does anybody know where I can find wxPythonCE sources? I'd like to make a port for Smartphone. From james.burkert at gmail.com Fri Jan 28 15:54:42 2005 From: james.burkert at gmail.com (James Burkert) Date: Fri Jan 28 15:54:47 2005 Subject: [PythonCE] IdleCE new version Message-ID: <42aeae22050128065476485807@mail.gmail.com> Hi Ed, I've got a small request on your new version. It looks great! But, I can't seem to navigate into any subfolders from the open/save menus. The dialog seems to have the same trouble a lot of other programs have on my iPAQ 2215, by default they don't allow too many subfolders to be listed. Additionally, the "All Folders" setting doesn't show ALL the py files, just the few that are in the same folder as IdleCE. Is there any way you could put in some kind of more conventional file browser, with a file tree and up-folder button? Is anyone else having this problem? Thanks!! James -- ---------- James Burkert Systems Integration and Mission Operations Colorado Space Grant Consortium My Schedule: https://webcal.colorado.edu/command.shtml?calid=burkert&view=weekview From mike at pcblokes.com Fri Jan 28 16:05:59 2005 From: mike at pcblokes.com (Michael Foord) Date: Fri Jan 28 16:06:04 2005 Subject: [PythonCE] IdleCE new version In-Reply-To: <42aeae22050128065476485807@mail.gmail.com> References: <42aeae22050128065476485807@mail.gmail.com> Message-ID: <41FA54D7.40309@pcblokes.com> James Burkert wrote: >Hi Ed, > >I've got a small request on your new version. It looks great! But, I >can't seem to navigate into any subfolders from the open/save menus. >The dialog seems to have the same trouble a lot of other programs have >on my iPAQ 2215, by default they don't allow too many subfolders to be >listed. Additionally, the "All Folders" setting doesn't show ALL the >py files, just the few that are in the same folder as IdleCE. > >Is there any way you could put in some kind of more conventional file >browser, with a file tree and up-folder button? > >Is anyone else having this problem? > > > Yes... *but* It is a problem with the standard windows dialog that Tk uses. An alternative would be to hack Tk to use an alternative dialog like tgetfile.dll by Scott Seligman. The alternative is to *build* a dialog from standard Tk parts... not much fun - but if you're volunteering :-) Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml >Thanks!! >James > > > From hentaidan at gmail.com Fri Jan 28 17:12:55 2005 From: hentaidan at gmail.com (Charles Barnes) Date: Fri Jan 28 17:12:57 2005 Subject: [PythonCE] IdleCE new version In-Reply-To: <41FA54D7.40309@pcblokes.com> References: <42aeae22050128065476485807@mail.gmail.com> <41FA54D7.40309@pcblokes.com> Message-ID: <72f07f37050128081210088cdd@mail.gmail.com> File Dialog Changer replaces the original windows one with a much better one. Even allows for program exceptions. It comes as .cpl control panel file I think, and takes a bit of searching to find on the website but its there. I've been using it for a while but had no problems. http://www.pocketpcfreewares.com/en/index.php?soft=752 On Fri, 28 Jan 2005 15:05:59 +0000, Michael Foord wrote: > James Burkert wrote: > > >Hi Ed, > > > >I've got a small request on your new version. It looks great! But, I > >can't seem to navigate into any subfolders from the open/save menus. > >The dialog seems to have the same trouble a lot of other programs have > >on my iPAQ 2215, by default they don't allow too many subfolders to be > >listed. Additionally, the "All Folders" setting doesn't show ALL the > >py files, just the few that are in the same folder as IdleCE. > > > >Is there any way you could put in some kind of more conventional file > >browser, with a file tree and up-folder button? > > > >Is anyone else having this problem? > > > > > > > > Yes... *but* > It is a problem with the standard windows dialog that Tk uses. > > An alternative would be to hack Tk to use an alternative dialog like > tgetfile.dll by Scott Seligman. > > The alternative is to *build* a dialog from standard Tk parts... not > much fun - but if you're volunteering :-) > > Regards, > > Fuzzy > http://www.voidspace.org.uk/python/index.shtml > > >Thanks!! > >James > > > > > > > > _______________________________________________ > PythonCE mailing list > PythonCE@python.org > http://mail.python.org/mailman/listinfo/pythonce > -- www.hentai-dan.com From anne.wangnick at t-online.de Fri Jan 28 17:57:57 2005 From: anne.wangnick at t-online.de (Anne Wangnick) Date: Fri Jan 28 17:58:20 2005 Subject: AW: [PythonCE] wxPythonCE sources In-Reply-To: Message-ID: Hello Alexey, this was the original email announcing the port. I guess Brian will be able to help you ... Regards, Sebastian -----Ursprungliche Nachricht----- Von: Im Auftrag von Brian Retford [brian@cococorp.com] Gesendet: Freitag, 17. Dezember 2004 20:56 An: pythonce@python.org Betreff: [PythonCE] wxPython on CE I nearly killed myself doing so, but I have a largely functional port of wxPython to CE. It is missing a few useful things (wxHTML, XRC, etc) but by and large it works well. It required a slightly modified version of the pythonce port that everyone seems to be using (namely I removed the spinning wait cursor, because wx is always doing something). I also made a pythonw that doesn't launch an interpreter. I can release binaries and source for any of these things. The CE port of wxPython is not presently in any state to contribute back to wxpython.org, sadly. I'd really like to get it there because I'd like both python on ce and wxpython to be supported by these projects formally. Let me know if there is interest and I'll get the files out there. Brian Retford Senior Developer www.cococorp.com -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von Alexey Pechonkin Gesendet: Donnerstag, 27. Januar 2005 12:57 An: pythonce@python.org Betreff: [PythonCE] wxPythonCE sources Hello all! Does anybody know where I can find wxPythonCE sources? I'd like to make a port for Smartphone. _______________________________________________ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce From anne.wangnick at t-online.de Fri Jan 28 18:58:02 2005 From: anne.wangnick at t-online.de (Anne Wangnick) Date: Fri Jan 28 18:58:24 2005 Subject: AW: [PythonCE] IdleCE new version In-Reply-To: <42aeae22050128065476485807@mail.gmail.com> Message-ID: Hi James, you might consider to use module FileDialog instead. E.g. for open you would do: import FileDialog def askopenfilename(root): return FileDialog.LoadFileDialog(root).go() or "" ... and then replace in method open(self) self.filename = tkFileDialog.askopenfilename(self.root) by self.filename = askopenfilename(self.root) Regards, Sebastian -----Ursprungliche Nachricht----- Von: pythonce-bounces@python.org [mailto:pythonce-bounces@python.org]Im Auftrag von James Burkert Gesendet: Freitag, 28. Januar 2005 15:55 An: pythonce@python.org Betreff: Re: [PythonCE] IdleCE new version Hi Ed, I've got a small request on your new version. It looks great! But, I can't seem to navigate into any subfolders from the open/save menus. The dialog seems to have the same trouble a lot of other programs have on my iPAQ 2215, by default they don't allow too many subfolders to be listed. Additionally, the "All Folders" setting doesn't show ALL the py files, just the few that are in the same folder as IdleCE. Is there any way you could put in some kind of more conventional file browser, with a file tree and up-folder button? Is anyone else having this problem? Thanks!! James -- ---------- James Burkert Systems Integration and Mission Operations Colorado Space Grant Consortium My Schedule: https://webcal.colorado.edu/command.shtml?calid=burkert&view=weekview _______________________________________________ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce From stewart.midwinter at gmail.com Sat Jan 29 18:44:50 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sat Jan 29 18:44:54 2005 Subject: [PythonCE] Tkinter installation Message-ID: I had PythonCE and Tkinter working on my PocketPC, but then suffered a hard reset. I decided to install them on the SD Card, but now I can't Python to find Tkinter. What am I doing wrong? I've got Python in \\SD Card\\Program Files\\Python\\Lib. I ran the Setup Registry shortcut (adjusting the path names to reflect the installation on the card, and Python itself will run properly. I opened up Tkinter-files.zip and copied the files in the Windows folder (celib.dll, tcl84.dll, tk84.dll) to my system's Windows folder. I then copied the tcl8.4 folder (containing two sub-folders) to the \\SD Card\\Program Files\\ folder. Is this the right place? Obviously not, I guess. Any hints? I'm keen to try out the latest idleCE !! thanks, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From james.burkert at gmail.com Sat Jan 29 19:43:50 2005 From: james.burkert at gmail.com (James Burkert) Date: Sat Jan 29 19:43:53 2005 Subject: [PythonCE] Tkinter installation In-Reply-To: References: Message-ID: <42aeae22050129104367536c3d@mail.gmail.com> Hey Stewart, Finally something I can be helpful with! I have tcl8.4.3 in the root directory \My Device\, next to Windows, Program files, etc. It works just fine there. I guess its just because thats how tcl is referenced in some file or another. Out of curiosity, what did you need to change to get Python to run properly from your SD card? James On Sat, 29 Jan 2005 10:44:50 -0700, Stewart Midwinter wrote: > I had PythonCE and Tkinter working on my PocketPC, but then suffered a > hard reset. I decided to install them on the SD Card, but now I can't > Python to find Tkinter. What am I doing wrong? > > I've got Python in \\SD Card\\Program Files\\Python\\Lib. I ran the > Setup Registry shortcut (adjusting the path names to reflect the > installation on the card, and Python itself will run properly. > > I opened up Tkinter-files.zip and copied the files in the Windows > folder (celib.dll, tcl84.dll, tk84.dll) to my system's Windows folder. > I then copied the tcl8.4 folder (containing two sub-folders) to the > \\SD Card\\Program Files\\ folder. Is this the right place? > Obviously not, I guess. > > Any hints? I'm keen to try out the latest idleCE !! > > thanks, > -- > Stewart Midwinter > stewart@midwinter.ca > stewart.midwinter@gmail.com > _______________________________________________ > PythonCE mailing list > PythonCE@python.org > http://mail.python.org/mailman/listinfo/pythonce > -- ---------- James Burkert Systems Integration and Mission Operations Colorado Space Grant Consortium My Schedule: https://webcal.colorado.edu/command.shtml?calid=burkert&view=weekview From stewart.midwinter at gmail.com Sat Jan 29 22:16:31 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sat Jan 29 22:16:34 2005 Subject: [PythonCE] Tkinter installation In-Reply-To: <42aeae22050129104367536c3d@mail.gmail.com> References: <42aeae22050129104367536c3d@mail.gmail.com> Message-ID: to get Python to run on the SD card, I edited setup_registry.py and Setup Registry.lnk to point to the location on the SD card where the python.exe lives, i.e. \\SD Card\\Program Files\\Python\\Lib. To confirm that my registry was in fact set up correctly, I used Advanced Explorer, went into the Registry and checked HKEY_CLASSES_ROOT for the existence of entries for .py and .pyc (and I added .pyw for good measure). By the way, my Tkinter works now, so thanks a lot! I also have the Pmw widget set working. No reason why BWidgets shouldn't work either. cheers S -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From focke at slac.stanford.edu Sun Jan 30 01:41:05 2005 From: focke at slac.stanford.edu (Warren Focke) Date: Sun Jan 30 01:41:18 2005 Subject: [PythonCE] Tkinter installation In-Reply-To: <42aeae22050129104367536c3d@mail.gmail.com> References: <42aeae22050129104367536c3d@mail.gmail.com> Message-ID: On Sat, 29 Jan 2005, James Burkert wrote: > Out of curiosity, what did you need to change to get Python to run > properly from your SD card? Stewart already posted how to get Python running off flash. You've still got the fact that python23.zip/lib-tk isn't in sys.path to deal with. I've seen a number of workarounds for this posted, but never the one that I hit on, which was to modify python23.zip to move the contents of lib-tk up to the top level. Warren Focke From james.burkert at gmail.com Sun Jan 30 01:44:40 2005 From: james.burkert at gmail.com (James Burkert) Date: Sun Jan 30 01:44:44 2005 Subject: [PythonCE] Tkinter installation In-Reply-To: References: <42aeae22050129104367536c3d@mail.gmail.com> Message-ID: <42aeae22050129164455b0b08d@mail.gmail.com> Yep, I saw that he did, he was kind enough to respond to my question. In order to get lib-tk in the sys.path, I just added sys.path.append('') to the bootup py script for Python 2.3.4, called pythonrc.py, located in \Temp\. This runs every time the interpreter starts, so I have not had trouble with it. James On Sat, 29 Jan 2005 16:41:05 -0800 (PST), Warren Focke wrote: > > > On Sat, 29 Jan 2005, James Burkert wrote: > > > Out of curiosity, what did you need to change to get Python to run > > properly from your SD card? > > Stewart already posted how to get Python running off flash. You've still > got the fact that python23.zip/lib-tk isn't in sys.path to deal with. > I've seen a number of workarounds for this posted, but never the one that > I hit on, which was to modify python23.zip to move the contents of lib-tk > up to the top level. > > Warren Focke > > -- ---------- James Burkert Systems Integration and Mission Operations Colorado Space Grant Consortium My Schedule: https://webcal.colorado.edu/command.shtml?calid=burkert&view=weekview From stewart.midwinter at gmail.com Sun Jan 30 04:43:28 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sun Jan 30 04:43:31 2005 Subject: [PythonCE] Tkinter installation In-Reply-To: References: <42aeae22050129104367536c3d@mail.gmail.com> Message-ID: On Sat, 29 Jan 2005 16:41:05 -0800 (PST), Warren Focke wrote: > I hit on, which was to modify python23.zip to move the contents of lib-tk > up to the top level. what exactly were your modifications? you took the contents of the lib-tk folder inside python23.zip and moved them up to the root folder of the zip file? cheers, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From focke at slac.stanford.edu Mon Jan 31 04:20:34 2005 From: focke at slac.stanford.edu (Warren Focke) Date: Mon Jan 31 04:20:48 2005 Subject: [PythonCE] Tkinter installation In-Reply-To: References: <42aeae22050129104367536c3d@mail.gmail.com> Message-ID: On Sat, 29 Jan 2005, Stewart Midwinter wrote: > On Sat, 29 Jan 2005 16:41:05 -0800 (PST), Warren Focke > wrote: > > > I hit on, which was to modify python23.zip to move the contents of lib-tk > > up to the top level. > > what exactly were your modifications? you took the contents of the > lib-tk folder inside python23.zip and moved them up to the root folder > of the zip file? Yes, just so. Warren Focke