From 998234938ab687069ab8c794f912bca520dfa252 Mon Sep 17 00:00:00 2001 From: "Johnson Ndugwa (ndugwaj)" Date: Thu, 1 Dec 2022 07:34:00 +0000 Subject: [PATCH] Create Machine_Status --- Machine_Status | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Machine_Status diff --git a/Machine_Status b/Machine_Status new file mode 100644 index 0000000..261d0ef --- /dev/null +++ b/Machine_Status @@ -0,0 +1,44 @@ +import tkinter as tk +from tkinter import ttk + + +root = tk.Tk() +root.title("Tab Widget") +tabControl = ttk.Notebook(root) + +tab1 = ttk.Frame(tabControl) + + +tabControl.add(tab1, text ='Machine Status') +tabControl.pack(expand = 1, fill ="both") + +ttk.Label(tab1, + text ="Welcome to Machine Status Control").grid(column = 0, + row = 0, + padx = 30, + pady = 30) + +v = tk.IntVar() +v.set(1) # initializing the choice, i.e. Python + +languages = [("Working", 101), + ("Not Working", 102), + ("Needs Supervision", 103)] + +def ShowChoice(): + print(v.get()) + +tk.Label(root, + text="""Choose the machine Status:""", + justify = tk.LEFT, + padx = 20).pack() + +for language, val in languages: + tk.Radiobutton(root, + text=language, + indicatoron = 0, + padx = 20, + variable=v, + command=ShowChoice, + value=val).pack(anchor=tk.W) +root.mainloop()