2017年10月2日 星期一

TKinter create a button which goes to a web page





from tkinter import *
import webbrowser

url = 'https://thenewboston.com'

def openUrl():
    webbrowser.open(url,2)

root = Tk()
myButton = Button(root, text='go to the new boston', command= openUrl)
myButton.pack()
root.mainloop()

沒有留言:

張貼留言

2024產專班 作業2 (純模擬)

2024產專班 作業2  (純模擬) 1) LED ON,OFF,TIMER,FLASH 模擬 (switch 控制) 2)RFID卡號模擬 (buttom  模擬RFID UID(不從ESP32) 3) 使用database需先create建立資料庫 Node-Red 程式 [...