Skip to content

Instantly share code, notes, and snippets.

View gunchev's full-sized avatar

Doncho N. Gunchev gunchev

View GitHub Profile
@gunchev
gunchev / terminalsize.py
Last active January 21, 2025 15:02 — forked from jtriley/terminalsize.py
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/python
'''
Get width and height of console
works on Linux, OS X, Windows, Cygwin(Windows) originally retrieved from:
http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python
updated by Doncho Nikolaev Gunchev <[email protected]> to work with python 2 and 3, make pylint happy.