On Tue, 2004-07-27 at 13:44, Jonathan Brandmeyer wrote:
> On Tue, 2004-07-27 at 13:25, Bruce Peterson wrote:
>
> > Interestingly -- the Remove Programs in the Control panel doesn't remove
> > Visual.py
> > After cleaning out the Visual directory, I installed Visual 2004-07-22
> > again (which doesn't have a visual.py) and ran my test program.
> > This time the error message was:
> > << snip additional trace back into my code>>
> > File "C:\Python23\TSWork\DDV_GS005.py", line 1510, in show_axis
> > text=timetext,height=self.seldict['tlabelsize'],box=0,line=0,opacity=0.0)
> > File "C:\Python23\Lib\site-packages\visual\primitives.py", line 230, in
> > __init__
> > process_init_args_from_keyword_dictionary(self, keywords)
> > File "C:\Python23\Lib\site-packages\visual\primitives.py", line 37, in
> > process_init_args_from_keyword_dictionary
> > displayobject.color = keywords['color']
> > ArgumentError: Python argument types in
> > None.None(label, vector)
> > did not match C++ signature:
> > None(visual::Label {lvalue}, boost::python::tuple)
> >
>
>
> This error was generated because you assigned the color of a label
> object to be a vector, when it wants a 3-tuple.
>
> If this is a serious problem for you, then I can implement a workaround
> that would accept any 3-element sequence to be a color, but I don't
> think it is appropriate to use vectors for specifying a color.
>
> In the meantime, you can use the built-in function tuple(sequence) to
> construct a tuple from any sequence (Visual's vectors are sequences), or
> you can use the special member function vector.as_tuple() for a faster
That would be vector.astuple(), with no '_'.
> conversion in performance-sensitive code.
-Jonathan
|