- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does calling Tk() actually do?
Tkinter is a Python package which comes with many functions and methods that can be used to create an application. In order to create a tkinter application, we generally create an instance of tkinter frame, i.e., Tk(). It helps to display the root window and manages all the other components of the tkinter application. We can initialize the tkinter instance by assigning the variable to it.
Example
In the following example, we will create an instance of tkinter frame and create a label widget.
#Import tkinter library from tkinter import * #Create an instance of tkinter frame or window win= Tk() #Set the geometry of tkinter frame win.geometry("750x250") #Create a Label widget label= Label(win, text="Open Source Learning is Awesome!", font= ('Courier 20 underline')) label.pack() win.mainloop()
Output
- Related Articles
- What does opening a file actually do on Linux?
- Does Newton’s third law apply to a system where bodies do not actually touch each other?
- What Does the // Operator Do?
- What HTML5 File.slice method actually doing?
- What does the method toArray() do?
- What does "print >>" do in python?
- What Does a VPN Tunnel Do?
- What does [::-1] do in Python?
- What does an orthopaedic surgeon do?
- What does axes.flat in Matplotlib do?
- What does Tensor.detach() do in PyTorch?
- What does backward() do in PyTorch?
- What does the pandas.series.array attribute do?
- What does the pandas.series.index attribute do?
- What does the pandas.series.values attribute do?

Advertisements