Files
morbidissimo/modman/scripts/test3-global-class.py
2021-02-07 16:27:41 +00:00

24 lines
270 B
Python
Executable File

#!/usr/bin/env python
class Counter:
def __init__(self):
self.n = 0
def inc(self):
self.n += 1
def __str__(self):
return str(self.n)
counter = Counter()
def run():
print("Test Global Class:", counter)
counter.inc()