Is there a way within Python, perhaps using sys and os, to determine the size of the window in which you are running Python. I can do this in emacs using keyboard to run an emacs function, but not in general.
I did not work too hard at it, but the other answers (for me) failed in Windows using Anaconda3 Python. Perhaps someone else could try them in an emacs environment, which is where I tried them. They do return answers that appear to be defaults because they do not match my window size.