![]() |
|
|
+ Search |
![]()
|
May 12th, 2006 20:37
Reed O'Brien, Marco Aschwanden,
Python strings are immutable. Period. Maybe you want a memory file? >>> import StringIO >>> x = 'This is a string' >>> buffer = StringIO.StringIO() >>> buffer.write(x) >>> y = 'More string I want to add to the buffer' >>> buffer.write(y) >>> print buffer.getvalue() This is a string More string I want to add to the buffer >>> buffer.close()