numbers to string

Paul Rubin http
Wed Oct 25 05:00:31 CEST 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