codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#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() import re line='1,2,3\n4,5,6\n7,8,9' line = re.sub(CONST.COMMA, CONST.EMPTYSTR, line.rstrip()) print line
Private
[
?
]
Run code
Submit