Wednesday, August 5, 2020

Write a Program Add a Checkbox widget in Python.

Add a Checkbox widget in Python.

from tkinter import *

from tkinter.ttk import *

window = Tk()

window.title("Welcome to Coding Block!")

window.geometry('350x200')

check_state = BooleanVar()

check_state.set(0)

cb = Checkbutton(window, text='BMW', var=check_state)

cb.grid(column=0, row=0)

window.mainloop()

OUTPUT

Add a Checkbox widget

Tkinter checkbox


No comments:

Post a Comment

Please do not any spam link in Comment Box