阅读背景:

python / tkinter在按下按钮时将单词的单个字母添加到标签

来源:互联网 
from tkinter import *

# Create a window
spell_window = Tk()

# Give the window a title
spell_window.title('Spell Table')


table_Var = StringVar()

## table = ['T', 'a', 'b', 'l', 'e'] ## I think it needs to move through a list???

def spell_table():
    s_table = monty_Var.get()
    s_table += 'T' #Currently adds a 'T' each time the button is pressed
    monty_Var.set(s_table)



the_label = Label(spell_window, width = 10, textvariable = table_Var,
                  font = ('Arial', 30), bg = 'red')

the_button = Button(spell_window, text = 'Next letter', command = spell_table)

the_label.pack(padx = 0, pady = 0)

the_button.pack(padx = 40, pady = 0)
from tkinter import *

# Create a window
spell_



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: