python如何声明全局函数

在python中声明全局函数的方法

class ClassWithGlobalFunction:

global spam

def spam(): return 'eggs'

def method(self):

global monty

def monty(): return 'python'

Both comments and pings are currently closed.

Comments are closed.

Powered by KingAbc | 粤ICP备16106647号-2 | Loading Time‌ 0.371