一。GUI环境准备
不是说你装了python,就能界面编程
你需要装tcl和tk
#apt-get install python-tk
http://www.tcl.tk/software/tcltk/download.html
去下载吧
#tar -xzf tcl8.6.7-src.tar.gz
#tar -xzf tk8.6.7-src.tar.gz
#cd tcl8.6.7/unix
#./configure
#make && make install
cd ..
cd ..
cd tk8.6.7/unix
#./configure
#make && make install
然后重新安装python,你要不知道如何安装python,请移步博主之前的文章
二。接下来,写个python界面
//test.py
from Tkinter import *
root = Tk()
li = ['C','Python','php','html','sql','java']
movie = ['css','jquery','bootstrap']
list1 = Listbox(root)
list2 = Listbox(root)
for item in li:
list1.insert(0,item)
for item in movie:
list2.insert(0,item)
list1.pack()
list2.pack()
root.mainloop()
/result
Finally:
有点儿别扭,是吧?
不过,我一直认为,“习惯就好”