class Loop:
O = 0
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
if Loop.O < 26:
Loop.O += 1
print(Loop.O, end=" ")
return True
class With:#aaaaaaaaクラス関数様万歳クラス関数様万歳
def __init__(self, params):
self.params = params
def name(self, func):
self.func = func
def go(self):
with self.params():
pass #クラス関数があるからこそ出来る!!!!!!!
A = With(Loop)
A.name(A.go)
A.go()#クラス関数があるからこそ出来る!!!!!!
#aaaaaaaaクラス関数様万歳クラス関数様万歳
To embed this project on your website, copy the following code and paste it into your website's HTML: