Create Clickable Tkinter Label

Dev Prakash Sharma
Updated on 07-Jun-2021 11:06:11

9K+ Views

Label widgets in Tkinter are used to display text and images. We can link a URL with the label widget to make it clickable. Whenever the label widget is clicked, it will open the attached link in the default browser.To work with the browser and hyperlinks we can use webbrowser module in Python. The module is accessible in Python extension library and can be installed by typing the command pip install webbrowser in the shell.ExampleIn this application, we will create a Label which turns out to be a Hyperlink referring to a webpage.# Import the required library from tkinter import ... Read More

Create Tkinter GUI Stop Button to Break Infinite Loop

Dev Prakash Sharma
Updated on 07-Jun-2021 11:04:21

2K+ Views

Tkinter is a Python library which is used to create GUI-based application. Let us suppose that we have to create a functional application in which a particular function is defined in a loop. The recursive function will display some text in a Label widget for infinite times.To stop this recursive function, we can define a function which changes the condition whenever a button is clicked. The condition can be changed by declaring a global variable which can be either True or False.Example# Import the required library from tkinter import * # Create an instance of tkinter frame win= Tk() ... Read More

Difference Between Grid and Pack Geometry Managers in Tkinter

Dev Prakash Sharma
Updated on 07-Jun-2021 11:01:58

1K+ Views

In order to view the widgets on the screen, we have to first associate each and every widget with the geometry manager. There are three ways in which we can view our widgets in the application. The Grid and Pack geometry manager are mostly used in many applications.Pack Geometry ManagerThe Pack geometry manager is one of the simplest geometry managers. We can use Pack manager to provide additional properties to the widgets such as padding, position respect to the X and Y axis, and expand property. It works on the basis of single row and single column. All the properties ... Read More

Set Entry Width in Python Tkinter

Dev Prakash Sharma
Updated on 07-Jun-2021 11:00:18

3K+ Views

Tkinter Entry widgets accept single-line user input in a text field. We can change the properties of the Entry widget by providing the default attributes and values in its constructor.Let us suppose that we want to create a full-width Entry widget for an application. There are several ways to do that but if we consider the simplest case where we use Pack Geometry Manager to display the Entry widget, then we can definitely set the width of Entry widget by adding fill(x or y) property.Example# Import the required library from tkinter import * from tkinter import ttk # Create ... Read More

Create Hyperlink in a Tkinter Text Widget

Dev Prakash Sharma
Updated on 07-Jun-2021 10:58:36

4K+ Views

Tkinter Text widgets are generally used for accepting multiline user input in the given text field. For a particular text document, the content may contain hyperlinks too which is useful in case we want to redirect the user. You can create hyperlinks within the text widget by using HyperLinkManager snippet in Python.The HyperLinkManager code snippet adds the hyperlink on the keyword within the text widget. Once the snippet has been downloaded, you can import it in the notebook by typing "from tkHyperLinkManager import HyperlinkManager"Example# Import the required libraries from tkinter import * from tkHyperLinkManager import HyperlinkManager import webbrowser from functools ... Read More

Using OpenCV with Tkinter

Dev Prakash Sharma
Updated on 07-Jun-2021 10:56:32

7K+ Views

Open CV is a Python library that is used to work with Computer Vision and other artificial artifacts. Open CV has inbuilt functions and methods which provide access to work with Computer Vision in Artificial Intelligence and Machine Learning. Some of the examples of Open CV are: face detection, object detection, X-ray and other industrial uses.Using Tkinter Library, we can create an interactive application that uses OpenCV as the essential part of the application.To create the application, you are required to install OpenCV in your local machine and make sure that Python Pillow package is pre-installed. You can install these ... Read More

Better Tkinter Geometry Manager Than Grid

Dev Prakash Sharma
Updated on 07-Jun-2021 10:53:58

449 Views

The Geometry Manager is one of the specific features in the Tkinter Library. It provides structure to all the Tkinter widgets in the window. The Geometry Manager is used for formatting the layout and position of the widget in a Tkinter application window.To format the look and appearance of any widget, we have three general methods in Geometry Manager.Pack Geometry ManagerGrid Geometry ManagerPlace Geometry ManagerEach Geometry Manager has some features that provide a different style and layout to the widgets. The Pack Geometry Manager is the most commonly used layout manager which gives access to add padding, margin, fill and ... Read More

Inheriting from Frame in a Tkinter Application

Dev Prakash Sharma
Updated on 07-Jun-2021 10:51:16

1K+ Views

In the Object-Oriented Programming Paradigm, Inheritance is used for acquiring the properties of the base class and using them in a derived class. Considering the case for a Tkinter application, we can inherit all the properties of a frame defined in a base class such as background color, foreground color, font properties, etc., into a derived class or a frame.In order to support Inheritance, we have to define a class that contains some basic properties of a frame such as height, width, bg, fg, font, etc.Example# Import Tkinter Library from tkinter import * # Create an instance of Tkinter ... Read More

What is Social Engineering Attack

PranavBhardwaj
Updated on 07-Jun-2021 10:19:07

1K+ Views

There are various ways cybercriminals conduct illicit activities. With the advancement in security technology, it has become challenging for them to deceive the security programs and attack the device. So, they are using the traditional technique in modern ways to infiltrate the system. This technique is known as the Social Engineering attack.In this post, we would discuss what Social Engineering attack is, how it is planned and performed, and how to prevent it from happening to you.What is Social Engineering AttackThe Social Engineering attack is one of the oldest and traditional forms of attack in which the cybercriminals take advantage ... Read More

What is Scareware?

PranavBhardwaj
Updated on 07-Jun-2021 10:18:19

363 Views

While browsing the Internet, many users might have received a pop-up alerting them of a virus attack on their system and asking for downloading an application to remove that virus. In anticipation of removing the virus, users download that application which is, in fact, a malicious program known as Scareware.Let us talk more about Scareware and learn how to deal with it.What is ScarewareScareware, also known as Fraudware, are malicious computer applications that pretend to be helpful to the user. As it is clear, the word Scareware is the combination of two terms, Scare and Software. It is basically the ... Read More

Advertisements