import type
class Test(object):
pass
t=Test()
def eat(self): #作爲導入方法這個self不能忘了
print(“eat”)
t.eat = types.MethodType(eat,p1)
import type
class Test(object):
pass
t=Test()
def eat(self): #作爲導入方法這個self不能忘了
print(“eat”)
t.eat = types.MethodType(eat,p1)
繼續運行 ?* 回憶上次內容 上次使用shell環境中的命令 命令 作用 c