import tkinter as tk`コードをここに入力`
import webbrowser
def hyperlink(event):
webbrowser.open_new(event.widget.cget('text'))
def program_start():
root.destroy()
return lambda : buff.set(True)
def program_quit():
root.destroy()
return lambda : buff.set(False)
root = tk.Tk()
buff = tk.BooleanVar()
buff.set(True)
lbl = tk.Label(root, text=r'https://google.co.jp',fg="blue", cursor="hand2")
lbl.pack()
lbl.bind("<Button-1>", hyperlink)
tk.Button(root, text = 'OK', width=10 , command = program_start).pack()
tk.Button(root, text = 'cancel', width=10 , command = program_quit).pack()
root.mainloop()
print (buff.get())
import tkinter as tk
import webbrowser
def hyperlink(event):
webbrowser.open_new(event.widget.cget('text'))
def program_start():
root.destroy()
return lambda : buff.set(True)
def program_quit():
root.destroy()
return lambda : buff.set(False)
root = tk.Tk()
buff = tk.BooleanVar()
buff.set(True)
lbl = tk.Label(root, text=r'https://google.co.jp',fg="blue", cursor="hand2")
lbl.pack()
lbl.bind("<Button-1>", hyperlink)
tk.Button(root, text = 'OK', width=10 , command = program_start).pack()
tk.Button(root, text = 'cancel', width=10 , command = program_quit).pack()
root.mainloop()
print (buff.get())