Re: Iterable Flattener with Depth.

2007-11-02 Thread Pradeep Jindal
On Friday 02 Nov 2007 10:43:45 pm Ian Clark wrote: thebjorn wrote: On Nov 2, 6:32 am, praddy [EMAIL PROTECTED] wrote: On Nov 1, 5:03 pm, [EMAIL PROTECTED] wrote: Pradeep Jindal: Any comments? Something with similar functionality (plus another 20 utility functions/classes or so) has

Iterable Flattener with Depth.

2007-11-01 Thread Pradeep Jindal
Hi, 5 minute solution to one of my requirements. I wanted to flatten iterables upto a specific depth. To be true, didn't search for it on the internet prior to writing this one. def flatten_iter(my_iter, depth=None): my_iter can be a iterable except string containing nested

Re: parse text file

2007-10-30 Thread Pradeep Jindal
On Tuesday 30 Oct 2007 12:06:57 pm william paul wrote: Hi: I am new to this list and new to Python. I have a text file that looks like: values 4 50 values 3 900 values] 7 400 ... values} 9 70 I want to be able to remove from each line everything up to or ] sign. For example: 4 50 3

Re: SQLObject - Connect to established DB with non-int 'id' field

2007-10-29 Thread Pradeep Jindal
On Saturday 20 Oct 2007 5:43:48 am Sean DiZazzo wrote: Hi all, I am just beginning with TurboGears and have run into a problem with SQLObject. I'm trying to connect to an established mysql DB, and use TurboGears to display results from the DB only. The problem is that the DB already has

Re: object inheritance

2007-10-27 Thread Pradeep Jindal
On Friday 26 Oct 2007 6:21:57 pm Anand wrote: On Oct 26, 5:31 pm, Pradeep Jindal [EMAIL PROTECTED] wrote: Can you tell any specific use case for doing this? I have many implementaions of a db interface. SimpleDB - simple implementation BetterDB - optimized implementation CachedDB

Re: object inheritance

2007-10-26 Thread Pradeep Jindal
Can you tell any specific use case for doing this? Regards, Pradeep On 10/26/07, Anand [EMAIL PROTECTED] wrote: I am trying to implement some kind of object inheritance. Just like one class can extend from another, I want to do the same on objects dynamically. I just thought that I can