Hello,
I've tried a few things, but still can't display this simple dialog at the center of the screen:
Thank you.
I've tried a few things, but still can't display this simple dialog at the center of the screen:
import tkinter as tk from tkinter import simpledialog #hide root window by using ".pyw" extension root = tk.Tk() windowWidth = root.winfo_reqwidth() windowHeight = root.winfo_reqheight() positionRight = int(root.winfo_screenwidth()/2 - windowWidth/2) positionDown = int(root.winfo_screenheight()/2 - windowHeight/2) root.geometry("+{}+{}".format(positionRight, positionDown)) root.overrideredirect(1) root.withdraw() answer = simpledialog.askstring("File", "Path to file?") if answer is not None: print("File is ", answer) root.destroy()Any idea?
Thank you.