from
tkinter
import
*
window
=
Tk()
window.title(
'Multiple selection'
)
yscrollbar
=
Scrollbar(window)
yscrollbar.pack(side
=
RIGHT, fill
=
Y)
label
=
Label(window,
text
=
"Select the languages below : "
,
font
=
(
"Times New Roman"
,
10
),
padx
=
10
, pady
=
10
)
label.pack()
list
=
Listbox(window, selectmode
=
"multiple"
,
yscrollcommand
=
yscrollbar.
set
)
list
.pack(padx
=
10
, pady
=
10
,
expand
=
YES, fill
=
"both"
)
x
=
[
"C"
,
"C++"
,
"C#"
,
"Java"
,
"Python"
,
"R"
,
"Go"
,
"Ruby"
,
"JavaScript"
,
"Swift"
,
"SQL"
,
"Perl"
,
"XML"
]
for
each_item
in
range
(
len
(x)):
list
.insert(END, x[each_item])
list
.itemconfig(each_item, bg
=
"lime"
)
yscrollbar.config(command
=
list
.yview)
window.mainloop()