python笔记:图形界面 列表框

 

# -*- coding: utf-8 -*-
"""
Created on Tue Jul 30 15:30:25 2019

@author: Administrator
"""

import tkinter
import tkinter.messagebox

top = Tk()
# --------------------------------

number = ['0','1','2','3','4']
letter = ['a','b','c','d','e']

#创建两个列表组件
listbox1 = Listbox(top)
listbox2 = Listbox(top)

for item in number:
    listbox1.insert(0,item)
    
for item in letter:
    listbox2.insert(0,item)

listbox1.pack()
listbox2.pack()

# --------------------------------
#进入消息循环
top.mainloop()

python笔记:图形界面 列表框_第1张图片

你可能感兴趣的:(python学习)