单选题

有如下程序:

import tkinter as tkwindow = tk.Tk()window.geometry('300x150')window.title('my first window')var = tk.StringVar() label = tk.Label(window, textvariable=var)label.pack()on_hit = Falsedef hit_me():    global on_hit    if on_hit == False:        var.set('You hit me')        on_hit = True    else:        var.set('')        on_hit = Falsebutton = tk.Button(window, text='hit me', width=15, height=1, command=hit_me)button.pack()window.mainloop()

下列说法不正确的是?()

A.

程序运行时,窗体上有1个Label和1个Button

B.

Button文字内容在'hit me'和'You hit me'间切换

C.

hit_me函数是按钮事件

D.

window.mainloop()省略不影响运行效果

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部