我想得到终端的大小.我正在使用此功能:
import sys, struct, fcntl, termios
s = struct.pack('HHHH', 0, 0, 0, 0)
t = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, s)
print(struct.unpack('HHHH', t))
Run Code Online (Sandbox Code Playgroud)
但到底是termios.TIOCGWINSZ什么?
| 归档时间: |
|
| 查看次数: |
4677 次 |
| 最近记录: |