c1 = tk.Checkbutton(window, text='Python',variable=var1, onvalue=1, offvalue=0, command=print_selection)
c1.pack()
c2 = tk.Checkbutton(window, text='C++',variable=var2, onvalue=1, offvalue=0, command=print_selection)
c2.pack()
from tkinter import *
master = Tk()
var01 = IntVar()
Checkbutton(master, text='male', variable=var01).grid(row=0, sticky=W)
var02 = IntVar()
Checkbutton(master, text='female', variable=var02).grid(row=1, sticky=W)
var03 = IntVar()
Checkbutton(master, text='other', variable=var03).grid(row=2, sticky=W)
mainloop()
w = CheckButton(master, option=value)