On 10/11/11 10:59 AM, Ed Leafe wrote:
> I don't use numpy, so let me ask this: how would the dImage Picture
> setter be able to recognize that it is being passed such an array?
>>> import numpy
>>> numpy.array
<built-in function array>
>>> a = numpy.array()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Required argument 'object' (pos 1) not found
>>> a = numpy.array("a")
>>> a
array('a',
dtype='|S1')
>>> type(a)
<type 'numpy.ndarray'>
>>> [i for i in dir(numpy) if "array" in i.lower()]
['array', 'array2string', 'array_equal', 'array_equiv', 'array_repr',
'array_split',
'array_str', 'asanyarray', 'asarray', 'asarray_chkfinite', 'ascontiguousarray',
'asfarray', 'asfortranarray', 'broadcast_arrays', 'chararray',
'compare_chararrays',
'get_array_wrap', 'get_numarray_include', 'ndarray', 'recarray']
So, I imagine you could check:
isinstance(picture, numpy.ndarray):
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]