#no const keyword in Python, so:
def constant(f):
def fset(self, value):
raise SyntaxError
def fget(self):
return f()
return property(fget, fset)
class _Const(object):
@constant
def COMMA():
return ','
@constant
def EMPTYSTR():
return ''
CONST = _Const()
line='1,2,3\n4,5,6\n7,8,9'
lines = line.replace(CONST.COMMA, CONST.EMPTYSTR)
print lines