这是我第一次编写任何东西,因为我必须很快完成这个项目,所以我没有一个合适的Python教程
事情是这样的:我需要编程一个带有两个输入框和一个按钮的小窗口
该按钮需要将条目添加到预先确定的超链接中。例如:
条目1:2020 条目2:12345
当我点击按钮时,它会打开,比如说,http://www.google.com/2020-12345.html
到目前为止,我的情况如下:
# !/usr/bin/python3
from tkinter import *
top = Tk()
import webbrowser
new = 1
url = "http://www.google.com/e1-e2"
def openweb():
webbrowser.open(url,new=new)
top.geometry("250x100")
name = Label(top, text="Numbers").place(x=50, y=1)
sbmitbtn = Button(top, text="Submit", command=openweb).place(x=90, y=65)
e1 = Entry(top).place(x=20, y=20)
e2 = Entry(top).place(x=20, y=45)
top.mainloop()
像这样:
相关问题 更多 >
编程相关推荐