Re: [Tutor] getattr works sometimes

2012-10-05 Thread Tino Dai
On Tue, Oct 2, 2012 at 8:39 PM, Steven D'Aprano wrote: > On 03/10/12 04:20, Tino Dai wrote: > >> and the get_class class works sometime for finding modules within a certain directory. If the get_class doesn't work, it throws an AttributeError. >>> >>> I don't really understand what

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Steven D'Aprano
On 03/10/12 04:20, Tino Dai wrote: and the get_class class works sometime for finding modules within a certain directory. If the get_class doesn't work, it throws an AttributeError. I don't really understand what you mean by this. Can you copy and paste the actual error message (all of it)?

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Steven D'Aprano
On 03/10/12 03:44, Tino Dai wrote: Hi All, I'm using the get_class from: http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname Do you mean this function? def get_class( kls ): parts = kls.split('.') module = ".".join(parts[:-1]) m

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Oscar Benjamin
On 2 October 2012 19:27, Tino Dai wrote: > On Tue, Oct 2, 2012 at 2:20 PM, Tino Dai wrote: and the get_class class works sometime for finding modules within a certain directory. If the get_class doesn't work, it throws an AttributeError. >>> >>> I don't really understand what you m

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Tino Dai
On Tue, Oct 2, 2012 at 2:20 PM, Tino Dai wrote: >>> and the get_class class works sometime for finding modules within a >>> certain directory. If the get_class >>> doesn't work, it throws an AttributeError. >> >> I don't really understand what you mean by this. Can you copy and >> paste the actual

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Tino Dai
>> and the get_class class works sometime for finding modules within a >> certain directory. If the get_class >> doesn't work, it throws an AttributeError. > > I don't really understand what you mean by this. Can you copy and > paste the actual error message (all of it)? > >> >> The module exists i

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Oscar Benjamin
On 2 October 2012 18:44, Tino Dai wrote: > Hi All, Hi Tino > > I'm using the get_class from: > > http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname Can you show the relevant portion of your code please? > > and the get_class class works sometim

[Tutor] getattr works sometimes

2012-10-02 Thread Tino Dai
Hi All, I'm using the get_class from: http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname and the get_class class works sometime for finding modules within a certain directory. If the get_class doesn't work, it throws an AttributeError. The modul