1You can't define a constant in Python unlike in other language, hence you can
2just make the variable all CAPS and add a comment using '#' saying that this is
3a constant variable.
1class CONST(object):
2 __slots__ = ()
3 FOO = 1234
4
5
6CONST = CONST()
7
8print(CONST.FOO) # 1234
9
10CONST.FOO = 4321 # AttributeError: 'CONST' object attribute 'FOO' is read-only
11CONST.BAR = 5678 # AttributeError: 'CONST' object has no attribute 'BAR'
12