I do this:
a = \'hello\'
And now I just want an independent copy of a:
a
import copy b = str(a) c = a[:] d = a
You can copy a string in python via string formatting :
>>> a = 'foo' >>> b = '%s' % a >>> id(a), id(b) (140595444686784, 140595444726400)