Re: Using ElementTree to tidy up an XML string to my liking

2006-02-23 Thread Simon Dahlbacka
..I hope that you are aware that xml is *case sensitive* -- http://mail.python.org/mailman/listinfo/python-list

Re: exceptions from logging on Windows

2005-09-12 Thread Simon Dahlbacka
I ended up monkey-patching doRollover to do a number of retries before giving up. (In our case the failures is due to our log browser happening to read the latest changes when logging wants to rollover) (Actually, I implemented a simple QueueHandler and do all file operations from a different

Re: functions without parentheses

2005-07-28 Thread Simon Dahlbacka
If you actually want that kind of syntax, then why don't you use Visual Basic? ;) -- http://mail.python.org/mailman/listinfo/python-list

spurious syntax error when updating to 2.4 ?

2005-07-21 Thread Simon Dahlbacka
Hi, I'm doing some preparation for a hopefully upcoming transition to python 2.4 (from 2.3.4) on winxp platform However, I'm getting SyntaxErrors in files that worked fine in 2.3, it tells me that e.g. newLanguage.language = languageElement[0].firstChild.data.encode(ascii) this line is broken

Re: spurious syntax error when updating to 2.4 ?

2005-07-21 Thread Simon Dahlbacka
Replying to self, it seems to be related to https://sourceforge.net/tracker/index.php?func=detailaid=1163244group_id=5470atid=105470 (Syntax error on large file with MBCS encoding) even though my files had # -*- coding: ascii -*- However, if I removed this explicit ascii encoding then I did not

Re: Printing a variable's name not its value

2005-07-20 Thread Simon Dahlbacka
as you have been told, there is no way to get a variable's name, take a look at http://effbot.org/zone/python-objects.htm to find out why this is so. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython wxGlade

2005-07-20 Thread Simon Dahlbacka
basically, you can just stack an outer vertical box sizer with two items and in the upper slot you put a horizontal box sizer with your two buttons and in the bottom slot you put the big button hope this helps /Simon ps. as this is a wxpython related question, you might get better answers on

Re: Documentation bug: Python console behaviour changed

2005-07-19 Thread Simon Dahlbacka
My console follows documentation: C:\tmp\GspRegTestAppc:\Python24\python ActivePython 2.4.1 Build 245 (ActiveState Corp.) based on Python 2.4.1 (#65, Mar 30 2005, 09:33:37) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. ^Z

Re: How to send a query to the browser from time to time?

2005-07-19 Thread Simon Dahlbacka
Short answer: Not using HTTP. However, you can use something like AJAX to just load new data from time to time and not the entire page. Or you might be able to keep the connection alive and occationally send stuff to the client using chunked transfer. I'd go for the ajax route if you don't need

Re: Efficiently Split A List of Tuples

2005-07-18 Thread Simon Dahlbacka
Oooh.. you make my eyes bleed. IMO that proposal is butt ugly (and looks like the C++.NET perversions.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with threads

2005-07-18 Thread Simon Dahlbacka
You cannot really do that*. Use a flag or something that the thread checks if it should shut down. /Simon * well actually you can, sort of by using int PyThreadState_SetAsyncExc( long id, PyObject *exc) from C API. However, if you do that you swap one problem for a sh*tload of others, because of

Re: Image orientation and color information with PIL?

2005-07-18 Thread Simon Dahlbacka
if you mean that you want to figure out which way the image is depending on the actual data in the image, then you'll most likely get to do the image processing yourself, on the other hand, if you are talking jpegs from a relatively new camera then I suppose that you should be able to get that

Re: Python Programming Contest

2005-07-15 Thread Simon Dahlbacka
Are you aware of http://mathschallenge.net/index.php?section=project ? The The focus will be on algorithms that require a bit of thought to design but not much code to implement. part seems common, although your problem domain probably is larger. /Simon --

Re: Documenting extension modules?

2005-07-15 Thread Simon Dahlbacka
Re: assigning a PyStr object to __doc__, take a look at Py_InitModule3, which does that for you. Then you have the PyDoc_STRVAR macro in python.h that you might want to use (see definition below). But as Robert already told you, you'll need to provide the necessary information about i.e.

Re: How do I parse this ? regexp ? [slighly OT]

2005-04-28 Thread Simon Dahlbacka
safetyChecker = re.compile(r^[-\[\]0-9,. ]*$) ..doesn't the dot (.) in your character class mean that you are allowing EVERYTHING (except newline?) (you would probably want \. instead) /Simon -- http://mail.python.org/mailman/listinfo/python-list

logging problems

2005-04-28 Thread Simon Dahlbacka
Hi, I'm currently using python 2.3.4 and I'm having problem with the logging module. Occasionally when logging something with exc_info=True it just hangs, nothing is logged, and software cannot continue executing. By drilling down into logging package and adding rather many print statements