Python 3 Tkinter Script to Build Full Screen Window Using attributes() and geometry() Functions in GUI Desktop App

Python 3 Tkinter Script to Build Full Screen Window Using attributes() and geometry() Functions in GUI Desktop App

Python 3 Tkinter Script to Build Full Screen Window Using attributes() and geometry() Functions in GUI Desktop App

# importing tkinter for gui 
import tkinter as tk 

# creating window 
window = tk.Tk() 

# setting attribute 
window.attributes('-fullscreen', True) 
window.title("Geeks For Geeks") 

# creating text label to display on window screen 
label = tk.Label(window, text="Hello Tkinter!") 
label.pack() 

window.mainloop()
# importing tkinter gui 
import tkinter as tk 

#creating window 
window=tk.Tk() 

#getting screen width and height of display 
width= window.winfo_screenwidth() 
height= window.winfo_screenheight() 
#setting tkinter window size 
window.geometry("%dx%d" % (width, height)) 
window.title("Geeeks For Geeks") 
label = tk.Label(window, text="Hello Tkinter!") 
label.pack() 

window.mainloop()
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment