GUI

GUI#

由于 “欢迎消息” 每次编译都会弹出提示框,很麻烦,所以这里给注释掉了。

# Python GUI
import matplotlib # must in the very begining
matplotlib.use('Agg')

from tkinter import *
import tkinter.simpledialog as dl
import tkinter.messagebox as mb

#tkinter GUI Input Output Example
#设置GUI
root = Tk()
w = Label(root, text = "Label Title")
w.pack()

#欢迎消息
# mb.showinfo("Welcome", "Welcome Message")
# guess = dl.askinteger("Number", "Enter a number")
# output = 'This is output message'
# mb.showinfo("Output: ", output)
'ok'