Python tkinter

The tkinter package (“Tk interface”) is the standard Python interface to the Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, as well as on Windows systems.

 

# -*- coding: UTF-8 -*-
import tkinter
from tkinter import Listbox

root = tkinter.Tk()

li = ['C','python','php','html','SQL','java']
listb  = Listbox(root)

for item in li:
    listb.insert(0,item)

listb.pack()  # 将小部件放置到主窗口中
root.mainloop() # 进入消息循环

 

posted @ 2019-01-29 10:16  牧 天  阅读(154)  评论(0)    收藏  举报