当按钮被按下时,您如何制作它? 撰写方式:Python + Tkinter
#The Button
button = tk.button(bg="orange", font=7, text="Visit Website")
visitWebsite.place(relx=0.4, rely=0.2)
答案 0 :(得分:0)
您可以使用webbrowser模块:
import webbrowser
url = 'https://sitename.com'
#The Button
visitWebsite = tk.button(bg="orange", font=7, text="Visit Website" command=lambda: webbrowser.open(url))
visitWebsite.place(relx=0.4, rely=0.2)