Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / gist:4000231
Created November 2, 2012 11:09
termsize
# -*- coding: utf-8 -*-
from ctypes import c_ushort, sizeof, Structure
import fcntl
import sys
import termios
class WinSize(Structure):
'''To get the terminal size information via the UNIX systemcall