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

沒有留言:

張貼留言

DHT11 (Node-Red) +PostgreSQL 模擬

 DHT11 (Node-Red) +PostgreSQL 模擬 [{"id":"acddd911a6412f0a","type":"inject","z":"08dc4...