'''
Created on 2018年1月24日
@author: Vision_TXG
'''
#导入tkinter库
from tkinter import *
import tkinter.simpledialog as dl
import tkinter.messagebox as mb #信息框
#Tk()是tkinter自带的构造函数,主函数的显示框
root = Tk()
#标签 标签的显示框和标题
w = Label(root,text = "Lable Title")
#自带调节标签大小
w.pack()
#进入画面
mb.showinfo("Welcome", "Welcome to Guess Number Game")
number = 66
while True:
#提供一个给用户输入的对话框
guess = dl.askinteger("Number", "What's you guess?")
if guess == number:
output = "Bingo! you guessed it right"
mb.showinfo("Hint:",output)
break
elif guess < number:
output = "No,the number is a higer than that"
mb.showinfo("Hint:",output)
else:
output = "No,the number is a lower than that"
mb.showinfo("Hint:",output)