[SciPy-user] Traits: Problem with Python 2.3 - Solved
Donald 'Paddy' McCarthy
paddy3118 at netscape.net
Sun May 25 14:35:54 EDT 2003
Erm,
It would help If I had wxPython installed...
paddy3118 at netscape.net wrote:
>
>
> Hi, I am having a problem with a very simple example that runs with
> Python22 but fails in Python 23?
>
> The error message is:
>
> Python 2.3b1 (#40, Apr 25 2003, 19:06:24) [MSC v.1200 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license" for more information.
> IDLE 0.8 -- press F1 for help
> >>>
> Traceback (most recent call last):
> File "C:\Documents and Settings\Paddy\My
> Documents\traitScript1.py", line 4, in ?
> class Person ( HasTraits ):
> File "C:\Documents and Settings\Paddy\My
> Documents\traitScript1.py", line 10, in Person
> __editable_traits__ = [
> NameError: name 'TraitGroup' is not defined
>
> >>>
>
> The example (that works for Python 22) is:
>
> from traits import *
>
>
> class Person ( HasTraits ):
> __traits__ = {
> 'name': '',
> 'age': 9,
> 'weight': 0.0
> }
> __editable_traits__ = [
> TraitGroup( 'name', style = 'custom'),
> TraitGroup( 'age', 'weight', style = 'custom'),
> TraitGroup( 'age', 'weight', 'name', style = 'custom')
> ]
>
> bill = Person()
>
> #bill.configure_traits( filename = None, edit = 1, traits = None )
> bill.configure_traits( filename = 'xx.save', edit = 1 )
> bill.edit_traits()
>
>
> Can anypne help?
>
> Thanks, Paddy.
>
More information about the SciPy-User
mailing list