def text(self, xy, text): text = string.joinfields(string.splitfields(text, "("), "\\(") text = string.joinfields(string.splitfields(text, ")"), "\\)") xy = xy + (text,) self.fp.write("%d %d M (%s) S\n" % xy)