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()

沒有留言:

張貼留言

作業2 MQTT (Relay + DHT22) 控制 ------- 利用Node-Red

作業2 MQTT (Relay + DHT22) 控制 ------- 利用Node-Red 1) 安裝Node-Red  https://ithelp.ithome.com.tw/articles/10201795 https://www.youtube.com/watch?v...