[SciPy-user] Traits: Problem with Python 2.3
Donald 'Paddy' McCarthy
paddy3118 at netscape.net
Sun May 25 12:41:48 EDT 2003
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20030525/e1dbce54/attachment.html>
More information about the SciPy-User
mailing list