python支持多种图形界面的第三方库,包括:Tk,Qt,GTK等。python自带的是支持Tk的Tkinter。

turtle

好可爱的绘图库...

width(5) # 设置笔刷宽度
pencolor('red') # 设置颜色
forward(200)
right(90)

Tkinter

廖雪峰的博客讲的不清楚啊...

抄的代码:

from tkinter import *


class Application(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()
        self.createWidgets()

    def createWidgets(self):
        self.helloLable = Label(self, text='Hello, world!')
        self.helloLable.pack()
        self.quitButton = Button(self, text='Quit', command=self.quit)
        self.quitButton.pack()


app = Application()
app.master.title('Hello, world')
app.mainloop()

将来学这个吧。