You can use winfo_width() and winfo_height() instead. I find that it's sometimes necessary to .update() before that to make sure that the window is actually as big as it's going to be, because otherwise you might get the size of a window that isn't ready yet. This would allow getting rid of pyautogui.
This project depends on pyautogui. It's used only for figuring out the size of a window:
You can use
winfo_width()
andwinfo_height()
instead. I find that it's sometimes necessary to.update()
before that to make sure that the window is actually as big as it's going to be, because otherwise you might get the size of a window that isn't ready yet. This would allow getting rid ofpyautogui
.There's also
winfo_reqwidth()
andwinfo_reqheight()
. I don't know which of those is whatpyautogui.size()
does.