Re: Simple HTML template engine?

2007-10-16 Thread jean-michel bain-cornu
Can anyone recommend a simple python template engine for generating HTML that relies only on the Pyhon Core modules? No need for caching, template compilation, etc. Speed is not a major issue. I just need looping and conditionals. Template inheritance would be a bonus. I have written

Re: Simple HTML template engine?

2007-10-16 Thread jean-michel bain-cornu
These days there seems to be more coverage of different needs. For instance, Mako looks like something I might have used if it had been around back then. It's probably the same to me. And many times, the simple python templating system %(var)s is good enough... --

Re: Mysqldb stderr

2007-10-01 Thread jean-michel bain-cornu
Hi, developing a daemon (using python 2.4 and mysqldb 1.2.1_p2) we notes that mysqldb class write on stderr some warnings and error asyncronously (uhmmm it's good written? ;P ). Someone knows how stop write on stderr (and stdout) on mysqldb? I use warnings filter : ...

Re: [ANN] Update to Python Quick Reference Card (for Python 2.4) (v0.67)

2007-05-15 Thread jean-michel bain-cornu
PC-cillin flagged this as a dangerous web site. An explanation would be fine about *why* the web site is flagged as dangerous... -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Free and Open Source Python IDE

2007-02-08 Thread jean-michel bain-cornu
On the OSS side, SPE is very good too - more of an IDE than Komodo Edit. DrPython is worth a look as is the similar Ulipad. Also have a look at Boa. Boa is excellent if you plan to use wxwidgets. Regards jm -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython: TextCtrl delayed update when using TE_RICH(2)

2007-02-05 Thread jean-michel bain-cornu
For this kind of stuff, I'd try to put self.out.WriteText(string) in some 'Idle' event, which avoid to fall in focus loops or other objects events management problems not easy to solve. This doesn't have anything to do with focus loops or otherwise, it's because the OP isn't familiar with

Re: wxPython: TextCtrl delayed update when using TE_RICH(2)

2007-02-05 Thread jean-michel bain-cornu
This is almost totally wrong. There is no new event loop involved. The OP is running a long task in the main thread, which is blocking the event loop. When the event loop is blocked, the application will not update and cannot be interacted with. It's that simple. The event loop in a gui

Re: Decimating Excel files

2007-02-04 Thread jean-michel bain-cornu
Hi, We have a data acquisition program that saves its output to Excel's ..xls format. Unfortunately, the programmer was too stupid to write files the average user can read. I'd like some advice on how to go about: 1. Reading a large Excel file and chop it into many Excel files (with only

Re: wxPython: TextCtrl delayed update when using TE_RICH(2)

2007-02-04 Thread jean-michel bain-cornu
Hi, def Execute(self, evt): print Start query time.sleep(5) The Start query message should show in the *messages* box when I press the button. Instead, it shows only after the time.sleep(5) delay. If I don't use the wx.TE_RICH / wx.TE_RICH2 style on *messages*, the text shows

Re: wxPython StatusBar Help

2007-01-30 Thread jean-michel bain-cornu
Hi, I'm working with wxPython 2.8.1.1. Does anybody know how to change the foreground colors in a wx.StatusBar You can get inspiration from the following code, but the problem is you will have also to draw all the status bar stuff, not only the foreground color. I don't know any other way.

Re: DCOP memory leak?

2007-01-30 Thread jean-michel bain-cornu
Now, I have to call DCOP very often and I noticed that every time I make a DCOP call my program keeps growing in memory size. To make sure it was DCOP i wrote the small program below: from dcopext import DCOPClient, DCOPApp while 0==0: dcop=DCOPClient() dcop.attach()

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread jean-michel bain-cornu
Hi Just for info - one of the reasons I stopped using Tkinter a few years ago was for the lack of print support (preview ...) - is there such an extension today ? Same for me, it was a point for what I choosed wx. Nowadays, I'd say users commonly accept to get pdf reports instead of direct

Re: smtplib question

2007-01-17 Thread jean-michel bain-cornu
The mail server in my organization is MS exchange. Obviously I can email to any email address from my MS outlook. What's the easiest way to fix the program? You will need to get smtplib to authenticate when connecting to the exchange server.Use the login function and the same

Re: IMAP SEARCH Error

2007-01-17 Thread jean-michel bain-cornu
imaplib.abort: command: SEARCH = unexpected response: '*' Can anyone tell me why this happens ? It looks like a server problem. What kind of server are you using ? Exchange, Cyrus ? Did you try with two different Imap servers ? If it is a unix server, did you have a look in /var/log ? Or in

Re: wxPython and Py2exe crashes in window mode but not in console mode

2006-08-25 Thread jean-michel bain-cornu
Hi Jerry, I have created an application using wxPython and compiled it using py2exe. When I put setup(console=['myscript.py']) in my setup.py file, the resulting application runs just fine. But when I change it to setup(windows=['myscript.py']) The application crashes without any

Re: wxPython Grid Question

2006-08-18 Thread jean-michel bain-cornu
I'm wonderg if there is a way to make a subclass of wx.grid.Grid in which the coloumn labels for the grid appear on the bottom of the grid instead of the top. follow that lead. But jean-michel has two good points: it could be easier to use 2 grids and http://wxpython.org/maillist.php would

Re: crash in wx.TreeListCtrl SelectItem()

2006-08-18 Thread jean-michel bain-cornu
Hi, I have a strange crash (segfault on FreeBSD) that I can not reliably reproduce and therefore unfortunately can not provide a self contained test case at the moment. Here is what I do (and what works almost always, but sometimes crashes): 1) find an item in a wx.TreeListCtrl by its

Re: wxPython Grid Question

2006-08-16 Thread jean-michel bain-cornu
Hi, Jordan a écrit : Hey Peoples, I'm wonderg if there is a way to make a subclass of wx.grid.Grid in which the coloumn labels for the grid appear on the bottom of the grid instead of the top. 1 2 3 4 5 a| | | | | | b| | | | | | c| | | | | | d| | |

Re: can wxpython checkbox use the fill in marker instead of the check?

2006-08-14 Thread jean-michel bain-cornu
jean-michel bain-cornu a écrit : i just like the look of the fill-in instead of the checkmark I'm just realizing it's a good idea ! I'm going to use it. Thanks ! Actually, there is a problem when one generates an exe application with py2exe. In that case, the 3rd style checkmark looks

Re: wxPython ListBook Class, Label Position w/ ImageList

2006-08-12 Thread jean-michel bain-cornu
Hi, By default the label position of an image list is below the image. Is there any way to change this? If it exists, it's undocumented, and there is not a sample. Did you ask the wx forum ? It's probably a better place to have this kind of information. If they provide you a C sample, I

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-04 Thread jean-michel bain-cornu
Hi, Thx for the two pointers. Are those widgets more than just tables, ie. can I edit the contents, including displaying a combo box, can items be grouped or hierarchized, or are they just basic, read-only tables to display results? I need this kind of widget to build a 2+ column interface

Re: Windows vs. Linux

2006-07-31 Thread jean-michel bain-cornu
Hi, [EMAIL PROTECTED] a écrit : Is Windows an okay enviornment in which to program under Python, or do you recommend that I run a dual-boot of Linux or maybe a VMWare install to program under Python? I'm used to practice windows linux and it makes sense to use python on both because the

Re: Windows vs. Linux

2006-07-31 Thread jean-michel bain-cornu
Andy Dingley a écrit : I'd never recommend dual-boot for anything! Don't agree man, it's good for testing... -- http://mail.python.org/mailman/listinfo/python-list

Re: can wxpython checkbox use the fill in marker instead of the check?

2006-07-26 Thread jean-michel bain-cornu
Hi, does anyone know if, for a 2-state checkbox, you can use the fill in marker from the 3-state checkbox, instead of a checkmark i just like the look of the fill-in instead of the checkmark Use a 3-state and change the state to 2 when you get the 1 state. Here is a working modification to

Re: can wxpython checkbox use the fill in marker instead of the check?

2006-07-26 Thread jean-michel bain-cornu
i just like the look of the fill-in instead of the checkmark I'm just realizing it's a good idea ! I'm going to use it. Thanks ! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread jean-michel bain-cornu
just a thought: if you *always* work with floats with two decimals, you are in fact working with integers, but you represent them as a floats - confusing for the internal representation. So why not work with int(float * 100) instead? This way you only have to take care of roundoffs etc when

Re: wxStyledTextCtrl and sql syntax highlightning

2006-06-21 Thread jean-michel bain-cornu
I have the following: self.__m_styled_text_ctrl = wxPython.stc.wxStyledTextCtrl( self, wx.NewId(), style=wxPython.wx.wxNO_FULL_REPAINT_ON_RESIZE) self.__m_styled_text_ctrl.SetLexer(wxPython.stc.wxSTC_LEX_SQL)

Re: wxPython GUI designer

2006-06-19 Thread jean-michel bain-cornu
[EMAIL PROTECTED] a écrit : I am newbie learning wxPython. I tried using GUI designer called wxGlade. When it generated code I couldnt get the same level of flexibility as writing the code by oneself. Any view on what you think about using GUI designer tools. Every help is appreciated.

Re: Newbie wxpython staticbitmap help please

2006-06-16 Thread jean-michel bain-cornu
Hi, janama a écrit : jean-michel bain-cornu wrote: Why won't you write it yourself using the demo ? It's clear and well documented. Regards, jm Hi, have been just trying for 5 hours with the timer demo in wx, i just havnt clicked with how to tie it in together, I know (think) i need

Re: Newbie wxpython staticbitmap help please

2006-06-15 Thread jean-michel bain-cornu
janama a écrit : Can somewhone add a wx.Timer example to this to make it check if the file exists every minute or so , instead of clicking the button to check and update this? Or is there a better way of auto updating my little gui apps StaticBitmap if a file exists? Why won't you

Re: Newbie wxpython staticbitmap help please

2006-06-15 Thread jean-michel bain-cornu
Thanks for any help with any of this I have no time at the moment. I'm going to try to give you an answer tomorrow morning (june 16) (if nobody did of course). See you jm -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython, tree Control text cutoff

2006-06-14 Thread jean-michel bain-cornu
Kiran a écrit : Hello all, I am using a tree to display stuff, and it is constantly updated, but what I have noticed is in the lowest level, there is clearly noticable cutoff of the text I place there. The cutoff is existent even if I do not update the text inside the tree constantly. It

Re: wxpython: bringing up a dialog box with a button

2006-06-13 Thread jean-michel bain-cornu
John Salerno a écrit : import wx class InputForm(wx.Frame): def __init__(self, parent=None, id=wx.ID_ANY, title=''): wx.Frame.__init__(self, parent, id, title) panel = wx.Panel(self) btnModal = wx.Button(panel, -1, 'Modal') dialog = wx.Dialog(self, -1,

Re: wxPython: Keyboard events and TreeCtrl

2006-06-12 Thread jean-michel bain-cornu
Am I supposed to connect the method to the Frame somehow? Or does it automatically get called when the user hits Ctrl-I, regardless of the fact that no other methods call OnKeyDown? I think it must be connected to the treectrl. One line or a combination of : self.Bind(wx.EVT_KEY_DOWN,

Re: Boa constructor- is it still alive?

2006-06-12 Thread jean-michel bain-cornu
tatamata a écrit : Does anyone know is Boa constructor project still alive? I visited Boa web site and it seems that it hasn't been updated for a long time I downloaded the version 0.4.4 a couple of months ago, so I guess the project is alive (I have been used the 0.3.1 before). I hope

Re: wxpython: how do i write this without the id parameter?

2006-06-12 Thread jean-michel bain-cornu
Hi John John Salerno a écrit : I was reading in the wxPython wiki that most of the time you don't have to include the id parameter at all, and you can just use keyword arguments for other parameters. But I'm having trouble converting this code into that method (i.e., without the id

Re: what are you using python language for?

2006-06-08 Thread jean-michel bain-cornu
This is my main development tool. I use it for business specific applications (with wx, cherrypy and mysql), mail server administration (in console mode and with cherrypy), and utilities. Regards jm -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython wxgrid question

2006-06-07 Thread jean-michel bain-cornu
[EMAIL PROTECTED] a écrit : Tim Roberts wrote: [EMAIL PROTECTED] wrote: I am looking for example code that consists of just a frame and a grid(10x2). The grid must fill the its parent even if the frame is resized. Have you gone through the wxPython demo application? It contains examples

Re: unicode error

2006-03-17 Thread jean-michel bain-cornu
[EMAIL PROTECTED] wrote: I have this python code: print htmlFile, div id=\track + unicode(1) + \ style=\width: 200px; height:18px;\; But that caues this error, and I can't figure it out why. Any help is appreicate File ./run.py, line 193, in ? print htmlFile, div id=\track +

Re: Python Debugger / IDE ??

2006-03-15 Thread jean-michel bain-cornu
[EMAIL PROTECTED] wrote: I've always been happy with the debugger in PythonWin. You can even use: from pywin.debugger import set_trace;set_trace() to bring up the debugger directly from a script that wasn't originally run in the ide. I use that one also. There is also Boa

Re: Python Debugger / IDE ??

2006-03-15 Thread jean-michel bain-cornu
bruno at modulix wrote: FWIW, I've almost never used a debugger with Python. It's pourtant very simpa from time to time ! -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write file with cp1250 encodings?

2006-03-03 Thread jean-michel bain-cornu
Hi, Grzegorz Smith wrote: Hi all. I have got situation: i load data from database(MSSQL) wchich are encoded cp1250 and I fill template with that data (Cheetah Template), after all i want to save template to file on disk. I'm using newfile = open(template.html,w) newfile.write(str(template))

Re: module time

2006-02-20 Thread jean-michel bain-cornu
Sergey wrote: There is function mktime() -- convert local time tuple to seconds since Epoch in module time. But how about to convert *GMT time tuple* to seconds since Epoch? Is there such function? Does mktime(gmtime()) suit your needs ? Regs, jm --

Re: editor for Python on Linux

2006-02-20 Thread jean-michel bain-cornu
Boa-Constructor is an IDE rather than an editor. Although it focuses on wxPython, it has a good editor. Yes, some possibilities are pretty good, like for instance the findAll/findInFiles keeping the results in a new tab (I never saw this elsewhere). Another useful is having the debugger

Re: Spanish Translation of any python Book?

2006-01-15 Thread jean-michel bain-cornu
Olaf El Blanco wrote: Maybe there is someone that speak spanish. I need the best spanish book for learning python. Thanks! Hola, Conoces La lista de python en castellano [EMAIL PROTECTED] ? Si intentas preguntar a ella, se podria que haya otras respuestas que aqui. Un saludo, jm --

Problem with auto-selection in wx masked control

2005-12-12 Thread jean-michel bain-cornu
Hi all, I'm trying to get the whole field selected when the caret arrives into a wx masked control. This is perfectly done with the program below. But if I comment out the line r= dlg.ShowModal(), I get something different : the data within the field is no more correctly selected. Why ? And is