fast way of turning a list of integers<256 into a string

Jonathan P. jbperez808 at yahoo.com
Mon Jan 13 17:44:51 EST 2003


s=''
for i in range(1,255):
  s+=chr(i)

has horrible performance (primarily due to string
immutability I think).  Is there a function to do
the ff. instead:

x=range(1,255)
list2str(x)

and have x become a string?




More information about the Python-list mailing list