python如何制作一个简单界面
1个回答
展开全部
使用Tkinter库
from tkinter import *
win = Tk()
#win.title('google search engine optimal')
win.title('一个测试程序')
# the top level of the window
def report(text):
#print(v.get())
entry2 = Label(root, text = v.get())
entry2.grid(row = 1, column = 1)
root = Frame(win)
root.pack()
label1 = Label(root, text = 'd 取值手动滑动条', width = 25)
label1.pack(side = LEFT)
label1.grid(row = 0, column = 0)
v = StringVar()
scl = Scale(root, from_ = 0, to = 1, tickinterval = 0.5, resolution = 0.01, orient = 'horizontal', variable=v, sliderlength = 10, width = 40, length = 200, command=report)
scl.grid(row = 0, column = 1)
print (scl.get())
label2 = Label(root, text = 'd当前取值:', height = 10)
label2.grid(row = 1, column = 0)
label3 = Label(root, text = 'PR=d*GPR+10*(1-d)*FPR :d越大则排序考虑人气越多。', height = 10)
label3.grid(row = 2)
root.mainloop()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询