How to create a static variable in python?
This question already has an answer here:
为了使用静态变量,你必须在类中使用它。
class XYZ:
value = 3
print(MyClass.value) // access it via class name
How's
class A(object):
v = 123
You access it simply as
A.v
链接地址: http://www.djcxy.com/p/78782.html
下一篇: 如何在python中创建一个静态变量?