-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
On windows+IDLE 2.7 get_terminal_size() returns default (80,25) #1714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there any way to get the size of the IDLE window? |
It goes wrong in Below is what it gives in IDLE. res should not be zero, but a tuple holding various terminal info. Because of res being zero default (80, 25) is returned by >>> from ctypes import windll, create_string_buffer
>>> h = windll.kernel32.GetStdHandle(-12)
>>> csbi = create_string_buffer(22)
>>> res = windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)
>>> print res
0 On the same machine, same python version but running python shell through pylab terminal size detection works fine. I`m not a windows python-user, and i have no immediate answer on how to fix it. |
IDLE is not a terminal, so it's not surprising that the Windows console functions (and Linux terminal functions) don't know about it. I expect using the IPython Qt console would have the same result. |
Tried IDLE on linux, |
@lodagro , is there a way to detect running under IDLE similarly to recent qtconsole work? |
From stackoverflow
Fails to detect the real IDLE display size and returns default (80, 25)
workaround is to use
pandas.set_printoptions(max_rows=200, max_columns=10)
The text was updated successfully, but these errors were encountered: