

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
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 Questions & Answers
- What does opening a file actually do on Linux?
- What HTML5 File.slice method actually doing?
- What does the method toArray() 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?
- What Does a VPN Tunnel Do?
- What actually made Apple a trillion dollar company?
- What does html() method do in jQuery?
- What does jQuery.serialize() method do in jQuery?
- What does jQuery.andSelf( ) method do in jQuery?
- What does jQuery.children() method do in jQuery?
Advertisements