嘿,我想在我点击按钮时显示一个函数的输出。我的函数在一个类中,我想在GUI的文本框中显示输出。有谁能帮我这里是功能代码。例如,我想从draw函数显示from random import shuffle
class spilastokkur():
def __init__(self):
self.spil=[]
self.bord=[]
self.hond=[]
def shuffle(self):
spil= self.spil
sort = ['H', 'S', 'T', 'L']
num = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13',]
for i in range(0,4):
for j in range(0, 13):
spil.append(sort[i]+ num[j])
shuffle(spil)
#print spil
return spil
def draw(self):
hond = self.hond
spil = self.spil
if len(hond) >= 3:
print 'Geturu fjarlaegt spil????'
if len(spil) > 0:
x