En Mon, 04 May 2009 15:12:41 -0300, mzdude <jsa...@cox.net> escribió:

substring isn't limited to 0..255
substring = "\0x%d\0x%d" % (257,257)
'acaccgac'.replace("ac", substring)
'\x00x257\x00x257\x00x257\x00x257cg\x00x257\x00x257'

This isn't what you think it is. Look carefully:

py> substring = "\0x%d\0x%d" % (257,257)
py> len(substring)
10
py> list(substring)
['\x00', 'x', '2', '5', '7', '\x00', 'x', '2', '5', '7']

--
Gabriel Genellina

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

Reply via email to