tkinter简单打开网址 + 执行系统命令

tkinter简单打开网址 + 执行系统命令
from tkinter import *
import webbrowser

root = Tk()

text = Text(root,width=30,height = 5)
text.pack()

text.insert(INSERT, "百度一下,你就知道")

text.tag_add("link","1.0","1.4")
text.tag_config("link", foreground="blue", underline = True)

def click(event):
    webbrowser.open("http://www.baidu.com")

text.tag_bind("link","",click)

mainloop()
posted on 2018-06-06 16:12 秦瑞It行程实录 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/ruiy/p/9145679.html

你可能感兴趣的:(tkinter简单打开网址 + 执行系统命令)