David Isaac wrote:
>>>> y
> [116, 114, 121, 32, 116, 104, 105, 115]
>>>> z=''.join(chr(yi) for yi in y)
>>>> z
> 'try this'
> 
> What is an efficient way to do this if y is much longer?
> (A numpy solution is fine.)

Here's another numpy solution just for fun:

import numpy
z = numpy.array(y,dtype='u1').view('S%d' % len(y))[0]


-Travis

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to