- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- 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
How to specify where a Tkinter window should open?
Tkinter window can be configured using the Geometry Manager. When we specify the main window using the geometry(width x height + position_right + position_left) method, then we generally enable the window to open in a particular position.
Example
#Import the required libraries from tkinter import * #Create an instance of Tkinter Frame win = Tk() #Set the geometry win.geometry("700x350+300+300") #Create a Label Label(win, text="This Window Opens at (300,300)", font=('Helvetica 15 bold')).pack(pady=30) win.mainloop()
Output
Running the above code will display a window at the specified position with a label text.
Advertisements