Re: [Tutor] Problems with a Class

2007-01-13 Thread thomas coopman
On Sat, 13 Jan 2007 01:08:53 +0100 Carlos <[EMAIL PROTECTED]> wrote: > Hello, > > I'm just about to finish my project, but something is causing me > trouble. I need to find out how to get some information out of the > genetic algorithm that Im using. This algorithm is generating some > coordin

[Tutor] import and unittest

2007-01-16 Thread Thomas Coopman
code and the test dir is a complete copy of the src dir but with unittest instead of code. I have something like this but I don't know how to organize the imports in the tests and I don't know if this is a good idea. What do you think? Thanks -- Thomas Coopman [EMAIL

Re: [Tutor] import and unittest

2007-01-16 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - "Alan Gauld" <[EMAIL PROTECTED]> wrote: > > "Thomas Coopman" <[EMAIL PROTECTED]> wrote > . > > I wondered if it was possible to do something like this: > > > > src/ > >-a_module/ > >

Re: [Tutor] import and unittest

2007-01-17 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - "Alan Gauld" <[EMAIL PROTECTED]> wrote: > > "Thomas Coopman" <[EMAIL PROTECTED]> wrote > . > > I wondered if it was possible to do something like this: > > > > src/ > >-a_module/ > >

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: thomas coopman wrote: > On Tue, 16 Jan 2007 10:06:37 - > "Alan Gauld" <[EMAIL PROTECTED]> wrote: > >> "Thomas Coopman" <[EMAIL PROTECTED]> wrote >> . >>>

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Thomas Coopman wrote: > Well I don't really > need the circular imports but I would like to know how to do the imports correct. > > Suppose that in the example that I showed only One needs Two. > > So then we ha

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Thomas Coopman wrote: > When I run One.py from in the directory A, doesn't look python in it's > parent directory when it can't find the module? > And if that's not the case where and what should I add to t

[Tutor] comparing almost equal strings

2007-02-08 Thread thomas coopman
Hi, I need a function that groups almost equal strings. It seems most easy to me, to do this with a hash function. So I would write a hash function like this: string = string.replace(" ", "").lower()[0:6] and then hash the string chars, but it should detect minor typo's, so words with one diffe

Re: [Tutor] comparing almost equal strings

2007-02-08 Thread thomas coopman
Hi, On Thu, 08 Feb 2007 13:07:41 +0100 Christopher Arndt <[EMAIL PROTECTED]> wrote: > thomas coopman schrieb: > > I need a function that groups almost equal strings. It seems most > > easy to me, to do this with a hash function. > > What do you mean be "a

[Tutor] class methods as argument

2007-02-10 Thread thomas coopman
Hi, I want to do something like this, don't know how to properly explain it, so I just give you some example code >>>class Foo(object): >>> def method(self, arg): >>> print arg >>>def doSomething(object, func): >>> object.func("test") >>>object = Foo() >>>doSomething(object,

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 22:10:52 +1000 Jonathan McManus <[EMAIL PROTECTED]> wrote: > It's pretty easy to make this work, actually. The issue is in the > "doSomething" method. > > > >>>class Foo(object): > > >>> def method(self, arg): > > >>> print arg > > > > >>>def doSomething(object, func)

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 07:55:54 -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: > thomas coopman wrote: > > Hi, > > > > I want to do something like this, don't know how to properly > > explain it, so I just give you some example code > > > >&

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 09:04:15 -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: > thomas coopman wrote: > > > > also, > > Is it better to use super in FooList? and how should I use it then? > > Actually I would say that FooList is not pulling its weight. > SortedL