numbers to string

Paul Rubin http
Tue Oct 24 23:00:31 EDT 2006


"David Isaac" <aisaac0 at verizon.net> writes:
> >>> 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?

import array
z = array.array('B',y).tostring()



More information about the Python-list mailing list