A diac is a two-terminal, three-layer, bidirectional device which can be switched from OFF state to ON state for both positive and negative polarity of the supply voltage.Constructional Details of the DiacThe basic structure of a Diac is similar to a BJT transistor. The only difference is that there is no base terminal in case of Diac.The terminals of the diac are taken from the two p-regions of silicon that are separated by an n-region. The concentrations are identical in all layers to give the device symmetrical properties.V – Characteristics of DiacFrom I-V Characteristics of a Diac, for the applied ... Read More
In practice, a rectifier is used to produce pure DC supply in electronic circuits. But the output of a rectifier is not pure DC, it has pulsations, i.e., it contains AC and DC components. The AC component is undesirable and must be removed. For this, a filter circuit is used."A Filter Circuit is a circuit which removes the ac component from the output of rectifier and produces the pure dc output across the load."The filter circuit should be placed between the rectifier and the load.A filter circuit is basically a combination capacitors (C) and inductors (L). A capacitor allows the ... Read More
A Listbox widget displays a list of items such as numbers list, items list, list of employees in a company, etc. There might be a case when a long list of items in a Listbox needs a way to be viewed inside the window. For this purpose, we can attach scrollbars to the Listbox widget by initializing the Scrollbar() object. If we configure and attach the Listbox with the scrollbar, it will make the Listbox scrollable.ExampleIn this example, we will create a Listbox with a list of numbers ranging from 1 to 100. The Listbox widget has an associated Scrollbar ... Read More
Scrollbars are useful to provide dynamic behavior in an application. In a Tkinter application, we can create Vertical as well as Horizontal Scrollbars. Scrollbars are created by initializing the object of Scrollbar() widget.To create a horizontal scrollbar, we have to provide the orientation, i.e., "horizontal" or "vertical". Scrollbars can be accessible once we configure the particular widget with the scrollbars.Example#Import the required libraries from tkinter import * #Create an instance of Tkinter Frame win = Tk() #Set the geometry of Tkinter Frame win.geometry("700x350") #Create some dummy Text text_v = "Python is dynamically-typed and garbage-collected. It supports multiple ... Read More
Let assume that we want to call a function whenever a button or a key is pressed for a particular application. We can bind the function that contains the operation with a button or key using the bind(', ' callback_function) method. Here, you can bind any key to the event or function that needs to be called.ExampleIn this example, we have created a function that will open a dialog box whenever we click a button.#Import the required libraries from tkinter import * from tkinter import ttk from tkinter import messagebox #Create an instance of Tkinter Frame win = Tk() ... Read More
Tkinter Text widget is an Input widget that supports multiline user input. It is also known as Text Editor which allows users to write the content and data in it. The content of the text widget can be cleared by defining the delete(0, END) command. Similarly, we can clear the content by clicking the Entry widget itself. This can be achieved by binding the function with a click event.Example#Import the required libraries from tkinter import * #Create an instance of Tkinter Frame win = Tk() #Set the geometry of Tkinter Frame win.geometry("700x250") #Define a function to clear ... Read More
Tkinter Entry widget is an input widget that supports only single-line user input. It accepts all the characters in the text field unless or until there are no restrictions set for the input. We can change the value of the Entry widget with the help of the Scale widget. The Scale widget contains a lower value and a threshold that limits the user to adjust the value in a particular range.To update the value in the Entry widget while updating the value of Scale widget, we have to create a variable that has to be given to both the scale ... Read More
Tkinter is a Python library that is used to develop desktop-based GUI applications. In order to develop a Tkinter application, we have to make sure that Python is installed in our local system. We can install Tkinter in our local machine by using the pip install tkinter command in the Command Prompt or shell.Once we enter the command pip install tkinter in the command shell, it will just start running the process of installing Tkinter in the local system.First, we will make sure that Python is installed in our system. In order to check if Python is installed, use the following ... Read More
The Tab order in any application decides which element of the application have to set focus. In a Tkinter application, it constantly looks for the next widget that needs to be focused on. To set the tab order in the application, we can define a function and pick all the widgets and use lift() method. It will allow the function to set the focus on a particular widget programmatically.Example#Import the required libraries from tkinter import * #Create an instance of Tkinter Frame win = Tk() #Set the geometry of Tkinter Frame win.geometry("700x350") #Add entry widgets e1 = ... Read More
Tkinter window contains many inbuilt functionalities and features which can be taken and used for various application development. There might be cases when we have to run a particular part of the application with the help of some key or function. It can be achieved by binding a particular key with the callback that contains the functions for the operation. The key can be anything from Mouse Buttons to Keyboard Keys. We can even bind the callback with Keyboard Key Combinations.Example#Import the Tkinter Library from tkinter import * #Create an instance of Tkinter Frame win = Tk() #Set ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP