1

尝试在 Canopy 编辑器中运行 Hello World 架子 - 出现以下错误

In [1]: %run /home/smarkov/Enthought/Canopy_64bit/User/Examples/enaml-0.2.0/hello_world/hello_world.py
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/home/smarkov/Canopy/appdata/canopy-1.4.0.1938.rh5-x86_64/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    202             else:
    203                 filename = fname
--> 204             __builtin__.execfile(filename, *where)

/home/smarkov/Enthought/Canopy_64bit/User/Examples/enaml-0.2.0/hello_world/hello_world.py in <module>()
      6 
      7 with enaml.imports():
----> 8     from hello_world_view import MyMessageToTheWorld
      9 
     10 view = MyMessageToTheWorld(message="Hello, world!")

/run/media/smarkov/Data/enaml-0.6.8/enaml/core/import_hooks.py in load_module(self, fullname)
    129         # module code of an Enaml file.
    130         with imports():
--> 131             exec code in mod.__dict__
    132         return mod
    133 

/home/smarkov/Enthought/Canopy_64bit/User/Examples/enaml-0.2.0/hello_world/hello_world_view.enaml in ()
      3 #  All rights reserved.
      4 #------------------------------------------------------------------------------
----> 5 enamldef MyMessageToTheWorld(MainWindow):
      6     attr message
      7     Container:

NameError: name 'MainWindow' is not defined 
4

0 回答 0