Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to create a hyperlink with a Label in Tkinter

#Import the required libraries
from tkinter import *
import webbrowser

#Create an instance of tkinter frame
win = Tk()
win.geometry("750x250")

#Define a callback function
def callback(url):
   webbrowser.open_new_tab(url)

#Create a Label to display the link
link = Label(win, text="www.tutorialspoint.com",font=('Helveticabold', 15), fg="blue", cursor="hand2")
link.pack()
link.bind("<Button-1>", lambda e:callback("http://www.tutorialspoint.com"))

win.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: skip rows in pandas read excel 
Python :: count unique values in pandas column 
Python :: add column names to dataframe pandas 
Python :: convert list to binary python 
Python :: how to install python libraries 
Python :: django querset group by sum 
Python :: python datetime into 12-hour format 
Python :: convert categorical data type to int in pandas 
Python :: how to get iheight in pyqt5 
Python :: python datetime last day of month 
Python :: python dataframe get numeric columns 
Python :: python convert hex to binary 
Python :: align columns to left pandas python 
Python :: scikit learn split data set 
Python :: print random word python 
Python :: python snake game 
Python :: recursive python program to print numbers from n to 1 
Python :: django queryset get all distinct 
Python :: change value to string pandas 
Python :: how to load wav file python 
Python :: how to print all combinations of a string in python 
Python :: how to find second maximum element of an array python 
Python :: list methods python 
Python :: python numpy kurtosis 
Python :: pyinstaller 
Python :: python ls directory 
Python :: how to say hello world in python 
Python :: opencv skip video frames 
Python :: get last file in directory python 
Python :: install python selenium webdriver 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =