Append a string to char array using fromstring method
suggest changeYou are able to append a string to a character array using fromstring(). As written, this sample fails: 'c' is not a Python 3 typecode, and fromstring has been removed. The replacement is frombytes.
my_char_array = array('c', ['g','e','e','k'])
my_char_array.fromstring("stuff")
print(my_char_array)
#array('c', 'geekstuff')
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents