I have this:
g_c = 0
class TestClass():
global g_c
def run(self):
for i in range(10):
g_c = 1
print(g_c)
t = TestClass()
t.run()
print(g_c)
how can I actually modify my global variable g_c?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…