/
githubmirror
/
you-get
Обзор
Документация
Войти
/
githubmirror
/
you-get
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/you_get/util/term.py
9 строк
303 B
Mort Yao
[term] fcntl module only available on Unix
22 окт 2015, 17:39
22 окт 2015, 17:39
ea30218
Код
Авторство
О чём код?
#!/usr/bin/env python def get_terminal_size(): """Get (width, height) of the current terminal.""" try: import fcntl, termios, struct # fcntl module only available on Unix return struct.unpack('hh', fcntl.ioctl(1, termios.TIOCGWINSZ, '1234')) except: return (40, 80)