Highlight Current Line of Text Widget in Tkinter

Dev Prakash Sharma
Updated on 05-Aug-2021 14:31:36

2K+ Views

We can use the Tkinter text widget to accept multiline user input. We can insert text, display information, and get the output from the text widget.To highlight the currently selected text in a text widget, we can use the tag_add() method that adds a tag in the current text only.Example# Import the required library from tkinter import * # Create an instance of tkinter frame win=Tk() # Set the geometry win.geometry("700x350") # Add a text widget text=Text(win, width=80, height=15, font=('Calibri 12')) # Set default text for text widget text.insert(INSERT, "Tkinter is a Python Library to create ... Read More

Print and Get User Input in a Text Box in Tkinter

Dev Prakash Sharma
Updated on 05-Aug-2021 14:29:33

9K+ Views

We can use the Tkinter text widget to insert text, display information, and get the output from the text widget. To get the user input in a text widget, we've to use the get() method. Let's take an example to see how it works.Example# Import the required library from tkinter import * from tkinter import ttk # Create an instance of tkinter frame win=Tk() # Set the geometry win.geometry("700x350") def get_input():    label.config(text=""+text.get(1.0, "end-1c")) # Add a text widget text=Text(win, width=80, height=15) text.insert(END, "") text.pack() # Create a button to get the text input b=ttk.Button(win, ... Read More

Stick Element to Bottom Right Corner in Tkinter

Dev Prakash Sharma
Updated on 05-Aug-2021 14:28:14

2K+ Views

Tkinter has many inbuilt features, functions, and methods that we can use to construct the GUI of an application. It is necessary to know how we can set the position of a particular widget in the application so that it becomes responsive in nature.Tkinter also provides geometry managers through which we can set the position of elements and widgets. The Place geometry manager is used for configuring the position of complex widgets.ExampleLet us suppose that we want our widget position to the bottom-right of the application window, then we can use place geometry manager with anchor property.# Import the required ... Read More

Align Text to the Right in TTK Treeview Widget

Dev Prakash Sharma
Updated on 05-Aug-2021 14:26:28

4K+ Views

The Treeview widget is used to display the data in a hierarchical structure. Generally, the data is represented through the table that contains a set of rows and columns. We can add the data in the form of a table with the help of the Treeview widget.To configure the position of the item in the column, we can use the anchor property. It sets the position of the Treeview widget column with the given value. Each row in the table is associated with a column. To align the text of the rows towards the right, we can use the anchor ... Read More

Tkinter Window Taskbar Guide

Dev Prakash Sharma
Updated on 05-Aug-2021 14:25:02

3K+ Views

A System Tray application is always created on the taskbar. Whenever an application is closed by the user, it will get its state running on the taskbar. To identify a System Tray application, we can provide an image or icon to its application.To create a System Tray icon of a Tkinter application, we can use the pystray module in Python. It has many inbuilt functions and methods that can be used to configure the System Tray icon of the application.To install pystray in your machine, you can type "pip install pystray" command in your shell or command prompt.To create a ... Read More

Knowledge Process Outsourcing (KPO)

M S Faisal
Updated on 05-Aug-2021 14:23:23

507 Views

Knowledge process outsourcing (KPO) is the practice of contracting out the performance of key, information-related business functions. Work is contracted out to people who usually have professional degrees and extensive experience in a particular field, which is known as KPO.Workers from a separate business or a division of same organization may do the information-related tasks for the corporation as a whole. The subsidiary may be located in the same nation as the parent company or in an offsite account in order to save money or other resources.Key Points BrieflyKnowing how to outsource knowledge-based work to competent subject matter specialists is ... Read More

Change Background Color of a Treeview in Tkinter

Dev Prakash Sharma
Updated on 05-Aug-2021 14:22:56

4K+ Views

The Treeview widget is designed to display the data in a hierarchical structure. It can be used to display the directories, child directories or files in the form of a list. The items present in the Listbox are called Listbox items.The treeview widget includes many properties and attributes through which we can change or modify its default properties. We can change the background of a treeview widget by defining the 'background' property in the constructor.Example# Import the required libraries from tkinter import * from tkinter import ttk # Create an instance of tkinter frame or window win = Tk() ... Read More

Knuckle Buster: What Is It and How Does It Work

M S Faisal
Updated on 05-Aug-2021 14:22:14

751 Views

Knuckle-buster is a slang term that indicates the financial usage of manual credit card imprinted. This was a device that was used before the introduction of point-of-sale terminals, that has become hugely popular.Knuckle-Buster – What Is It?The term knuckle buster represents the usage of manual credit card, that was used widely and there and was physically extremely exhausting for the vendors who would injure their knuckles literally. This was before the point-of-sale terminals were introduced and this caused some serious injurious.Despite it being known as zip-zap machines at the time, they proved to injure the vendors regularly and thus the ... Read More

Change Tkinter Default Title in OS Bar

Dev Prakash Sharma
Updated on 05-Aug-2021 14:20:43

942 Views

The Tkinter application window has many components: window size, title, navbar, menubar-component, etc. To configure the window attributes or properties, we can use the Window Manager toolkit defined in Tcl/Tk.To run the Window Manager attributes, use the command 'wm' with other keywords. The title of the window can be configured by using wm_title("title") or title("title") method.Example# Import the required libraries from tkinter import * # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") # Change the title of the window win.wm_title("My Window") Label(win, text="Hello, Welcome to Tutorialspoint...", ... Read More

Knowledge Engineering: Definition, Application and Example

M S Faisal
Updated on 05-Aug-2021 14:20:24

2K+ Views

In artificial intelligence (AI), knowledge engineering is a branch of the science that develops rules to apply to data in order to simulate the thinking process of a human expert. It examines the structure of a job or a choice in order to determine how a result is arrived at.A collection of problem-solving techniques, as well as the ancillary information is developed and given up as issues for the system to diagnose. The software developed as a consequence of this research will be used to help humans in diagnosing, troubleshooting, and fixing problems.Key Points BrieflyArtificial Intelligence (AI) has a subset ... Read More

Advertisements