Re: Unexpected string behaviour: txt = 'this' ' works'

2009-02-11 Thread Quentin Gallet-Gilles
*Literal* string concatenation has always been a part of Python : http://docs.python.org/reference/lexical_analysis.html#string-literal-concatenation On Wed, Feb 11, 2009 at 12:06 PM, c d saunter < christopher.saun...@durham.ac.uk> wrote: > I did a double take when debugging an error the other d

Re: reflection as in Java: how to create an instance from a classname

2009-01-05 Thread Quentin Gallet-Gilles
On Mon, Jan 5, 2009 at 5:34 PM, Bruno Desthuilliers wrote: > guss a écrit : > >> I cannot find a satisfying answer to this question on the web so let's >> try here. >> >> My problem is the following, I would like to instantiate some object >> from a configuration file that would contain class nam

Re: Question on Joining of list

2008-07-18 Thread Quentin Gallet-Gilles
Actually, since you want to keep the missing words apart from the found ones, it's not necessary to do that. Using "first_char" and "missing_word" (quoting Peter's code) as lists instead of strings comes to mind, then you can join both lists into a string once the code exits the for loop. Cheers,

Re:

2008-06-05 Thread Quentin Gallet-Gilles
I don't want to spoil the fun, so I'll just say that "range" is the key here. Quentin On Thu, Jun 5, 2008 at 3:43 PM, garywood <[EMAIL PROTECTED]> wrote: > Hi there. So I have a challenge in the Python book I am using (python > programming for the absolute beginner) that tells me to improve an

Re: unittest: Calling tests in liner number order

2008-05-23 Thread Quentin Gallet-Gilles
I personally don't see any benefit in this approach. By definition, unittests should be independent, so the order argument suggests a deeper issue. What's your use case ? Quentin On Fri, May 23, 2008 at 11:36 AM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Some time ago I asked whether is would

Re: Ruby with Netbeans question!

2008-02-24 Thread Quentin Gallet-Gilles
Hi Steve, Considering this is a Python list, I doubt you'll get much help for something related to Netbeans and Ruby. You're better off asking questions on the proper list : http://www.netbeans.org/community/lists/ Quentin On Sun, Feb 24, 2008 at 12:26 PM, Steve <[EMAIL PROTECTED]> wrote: > Hi

Re: Solve a Debate

2008-02-15 Thread Quentin Gallet-Gilles
If the data becomes much bigger, change your way of storing it, not the code. You don't want to code hundreds of "if - elif - else" because you have hundreds of different data, right ? TheDailyWTF is full of horror stories like this, by the way ;-) Data growth shouldn't result in modification in lo

Re: Loop in a loop?

2008-01-17 Thread Quentin Gallet-Gilles
On Jan 17, 2008 2:38 PM, Sacred Heart <[EMAIL PROTECTED]> wrote: > On Jan 17, 1:35 pm, [EMAIL PROTECTED] wrote: > > for i in zip(array1, array2): > > print i > > > > Although I take it you meant four d, the issue with this method is > > that once you hit the end of one array the rest of the ot

Re: Loop in a loop?

2008-01-17 Thread Quentin Gallet-Gilles
Hi, I'd consider using zip : >>> array1 = ['one','two','three','four'] >>> array2 = ['a','b','c','d'] >>> zip(array1, array2) [('one', 'a'), ('two', 'b'), ('three', 'c'), ('four', 'd')] >>> for one, two in zip(array1, array2): ... print one, two ... one a two b three c four d >>> HTH, Quenti