我最近才发现关于 kivy。Python 我最近也在学习。我想要应用程序,制作成 kivy,它有 2 个框用于输入文本并在单击按钮后返回带有结果的标签。这段代码必须在他里面:
def word_detect(a,b):
y = []
e = []
s = []
for counter in range(len(b)):
z = []
for word in a:
ml = 0
index = -1
for letter in word:
index += 1
if letter == (b[counter])[index]:
ml += 1
if ml == int((b[counter])[-1]):
z.append(word)
y.append(z)
e.extend(z)
for i in e:
if (y[0]).count(i)==(y[1]).count(i)==(y[2]).count(i)==1 and s.count(i)==0:
s.append(i)
return s
print word_detect(raw_input('list: '). upper(). split(','),raw_input('words: '). upper(). split(','))
'''
e.g:
list : total,relax,mixer,remix,scope,candy,water
words: helix 3, botex 1, below 2
result: ['relax']
RELAX
hELiX - 3 matched letters
boteX - 1 matched letter
bELow - 2 matched letters
'''