enthought

Instantiating a default instance for an Enthought trait

Instantiating a default instance for an Enthought trait Question: Consider this simple minimal example: from traits.api import Instance, Str, HasTraits class Person(HasTraits): name = Str(“hooked”) class Chair(HasTraits): sitting = Instance(Person) t = Chair() print t.sitting.name This fails since t.sitting evaluates to None. Enthought’s traits module will enforce that the type of t.sitting is a Person …

Total answers: 3

ImportError: No module named Cython.Distutils

ImportError: No module named Cython.Distutils Question: I’m having a strange problem while trying to install the Python library zenlib, using its setup.py file. When I run the setup.py file, I get an import error, saying ImportError: No module named Cython.Distutils` but I do have such a module, and I can import it on the python …

Total answers: 12

How can I fire a Traits static event notification on a List?

How can I fire a Traits static event notification on a List? Question: I am working through the traits presentation from PyCon 2010. At about 2:30:45 the presenter starts covering trait event notifications, which allow (among other things) the ability to automatically call a subroutine any time a trait has changed. I am running a …

Total answers: 2

PyAudio IOError: No Default Input Device Available

PyAudio IOError: No Default Input Device Available Question: I’m using PyAudio under the Enthought Python Distribution (Python 2.6.6) in Ubuntu 10.10 x64. >>> import pyaudio >>> pa = pyaudio.PyAudio() >>> pa.get_default_input_device_info() Traceback (most recent call last): File “<pyshell#24>”, line 1, in <module> pa.get_default_input_device_info() File “/usr/lib/python_epd/lib/python2.6/site-packages/pyaudio.py”, line 936, in get_default_input_device_info device_index = pa.get_default_input_device() IOError: No Default …

Total answers: 6