
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

19K+ Views
Tkinter is one of the widely used libraries for creating GUI-based applications. In order to create applications using Tkinter, we have to install and import the library in the notebook.First, we have to install the tkinter library in our local environment based on the Windows or Linux operating system.For Windows users −pip install tkinterorpip install tkFor Linux or Mac users −apt-get install python-tkOnce installed, the user can import the tkinter library in the notebook using the following command, from tkinter import* To check if tkinter is installed in the system or not, we can use the following command, import tkinter ... Read More

5K+ Views
To make a tkinter widget invisible, we can use the pack_forget() method. It is generally used to unmap the widgets from the window.ExampleIn the following example, we will create a label text and a button that can be used to trigger the invisible event on the label text widget.#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x250") #Set the resizable property False win.resizable(False, False) #Make the widgets Invisible def make_invisible(widget): widget.pack_forget() #Create a label for the window or frame label=Label(win, text="Hello ... Read More

3K+ Views
In order to make the tkinter window or the root window jump above all the other windows, we can use attributes method that will generally take two values specifying the “topmost” value and the other is a Boolean value.Example#Importing the library from tkinter import * #Create an instance of tkinter window or frame win= Tk() #Setting the geometry of window win.geometry("600x250") #Create a Label Label(win, text= "Hello Everyone!", font=('Helvetica bold', 15)).pack(pady=20) #Make the window jump above all win.attributes('-topmost', 1) win.mainloop()OutputRunning the above code will make the window stay above all other windows,Read More

10K+ Views
Tkinter initially creates a resizable window for every application. Let us suppose that we want to make a non-resizable window in an application. In this case, we can use resizable(height, width) and pass the value of height=None and width=None. The method also works by passing Boolean values as resizable(False, False).Example#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x250") #Set the resizable property False win.resizable(False, False) #Create a label for the window or frame Label(win, text="Hello World!", font=('Helvetica bold', 20), anchor="center").pack(pady=20) win.mainloop()OutputRunning the above code will ... Read More

13K+ Views
Whenever we create a GUI program, tkinter generally presents the output screen in the background. In other words, tkinter displays the program window behind other programs. In order to put the tkinter window on top of others, we are required to use attributes('- topmost', True) property. It pulls up the window on the upside.Example#Importing the library from tkinter import * #Create an instance of tkinter window or frame win= Tk() #Setting the geometry of window win.geometry("600x350") #Create a Label Label(win, text= "Hello World! ", font=('Helvetica bold', 15)).pack(pady=20) #Make the window jump above all win.attributes('-topmost', True) ... Read More

7K+ Views
Tkinter Entry widget is used to print and display a single line of text taken from the user Input. It is used for many applications such as creating login forms, signup forms, and other user interaction forms.We can set the default text for the Entry Widget using insert() function by passing the default text as the argument.ExampleIn this example, we have created an Entry widget that has a default text.#Import the tkinter library from tkinter import * #Create an instance of tkinter frame win = Tk() #Set the geometry win.geometry("650x250") #Create an Entry Widget entry= Entry(win) entry.insert(END, 'Enter ... Read More

3K+ Views
Let us suppose we want to change the border color of a tkinter widget. We can configure the widget by passing the highlightcolor, highlightbackground property of the widget.ExampleIn this example, we have created an Entry widget and a button that can be triggered to change the border color of the Entry Widget.#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x250") #Define a function to change the color of entry widget def change_color(): text.config(highlightthickness=2, highlightbackground="red") #Create a Entry widget for which we want ... Read More

10K+ Views
Tkinter Entry widget is used to display a single line text. Using tkinter Entry widget, we can set its value or content by triggering a button. It has mainly two types of operation: insert and delete.Using the Tkinter Button widget, we will set the content of the Entry widget.Example#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Define a function to change the value def change_text(txt): text.delete(0, END) text.insert(0, txt) #Set the geometry of frame win.geometry("600x250") #Create an Entry Widget text= Entry(win) text.pack() #Create a button ... Read More

9K+ Views
Tkinter creates a default window with its default size while initializing the application. We can customize the geometry of the window using the geometry method.However, in order to maximize the window, we can use the state() method which can be used for scaling the tkinter window. It maximizes the window after passing the “zoomed” state value to it.Example#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x400") #Create a text label Label(win, text="It takes only 21 days to create a new Habit", font=('Times New Roman ... Read More

4K+ Views
In order to change the default behavior of tkinter widgets, we generally override the option_add() method. The properties and values passed to option_add() method will reflect the changes in all the widgets in the application. Thus, changing the default font will affect the font for all the widgets defined in the application.ExampleHere we will pass two parameters into the option_add() method, i.e., option_add("*font", "font-family font-size font-style font-orientation").#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x400") #Change the default Font that will affect in all ... Read More