Sep-06-2018, 04:49 AM
(Sep-06-2018, 02:43 AM)Skaperen Wrote: i did not want to change it to a bytearray since, some day, maybe soon, there might be some unicode in there.You can use
array.array()
. The following code works in python 3 and 2>>> from array import array >>> s = array('u', u'Hello World') >>> s[6:] = array('u', u'Skaperen') >>> s array('u', 'Hello Skaperen')