python と tkinter を使用して、チェック ボックスで選択されたプログラムを実行するプログラムを作成しようとしています。
import sys
from tkinter import *
import tkinter.messagebox
def runSelectedItems():
if checkCmd == 0:
labelText = Label(text="It worked").pack()
else:
labelText = Label(text="Please select an item from the checklist below").pack()
checkBox1 = Checkbutton(mGui, variable=checkCmd, onvalue=1, offvalue=0, text="Command Prompt").pack()
buttonCmd = Button(mGui, text="Run Checked Items", command=runSelectedItems).pack()
それがコードですが、なぜ機能しないのかわかりませんか?
ありがとう。