mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
994bb3bdc5
add PikaUI test test PikauI_core passed save host_obj on methodArg support save host_obj for method
38 lines
662 B
Python
38 lines
662 B
Python
|
|
|
|
class Demo():
|
|
def __init__(self):
|
|
print("__init__")
|
|
self.funcs = []
|
|
self.funcs.append(self.a)
|
|
self.funcs.append(self.b)
|
|
self.funcs.append(self.c)
|
|
self.val = 'ppp'
|
|
|
|
|
|
def a(self):
|
|
print('a')
|
|
|
|
def b(self):
|
|
print('b')
|
|
|
|
def c(self):
|
|
print(self.val)
|
|
|
|
def get_funcs(self):
|
|
return self.funcs
|
|
|
|
class Test():
|
|
def funcs_test(self):
|
|
demo = Demo()
|
|
funcs = demo.get_funcs()
|
|
print('----------------------------')
|
|
for func in funcs:
|
|
demo.func = func
|
|
demo.func()
|
|
func()
|
|
|
|
test = Test()
|
|
test.funcs_test()
|
|
|