In this example you will learn to set window size to fullscreen in Tkinter.
Python code example:
1 2 3 4 5 6 |
import tkinter as tk root = tk.Tk() root.attributes('-fullscreen',True) |
Output:
Example 2:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# importing tkinter for gui import tkinter as tk # creating window window = tk.Tk() # setting attribute window.attributes('-fullscreen', True) window.title("Code4Example") # creating text label to display on window screen label = tk.Label(window, text="..::FULLSCREEN::..") label.pack() window.mainloop() |
Output: