python full screen without console/borders python full screen without console/borders tkinter tkinter

python full screen without console/borders


How about this for the screen resolution:

from Tkinter import *import ttkdef escape(root):        root.geometry("200x200")def fullscreen(root):        width, height = root.winfo_screenwidth(), root.winfo_screenheight()        root.geometry("%dx%d+0+0" % (width, height))        master = Tk()width, height = master.winfo_screenwidth(), master.winfo_screenheight()master.geometry("%dx%d+0+0" % (width, height))master.bind("<Escape>", lambda a :escape(master))#Added this for fun, when you'll press F1 it will return to a full screen.master.bind("<F1>", lambda b: fullscreen(master))master.mainloop()

And this for no border (taken from here):

import tkinter as tkroot = tk.Tk()root.attributes('-alpha', 0.0) #For icon#root.lower()root.iconify()window = tk.Toplevel(root)window.geometry("100x100") #Whatever sizewindow.overrideredirect(1) #Remove border#window.attributes('-topmost', 1)#Whatever buttons, etc close = tk.Button(window, text = "Close Window", command = lambda: root.destroy())close.pack(fill = tk.BOTH, expand = 1)window.mainloop()

The only solution for the console is to save the file as .pyw as you've already read. You can also try to override the Tk functions using overrideredirect(1) but that would be more complicated.

Hopefully this will help you, Yahli.