相关疑难解决方法(0)

什么是termios.TIOCGWINSZ

我想得到终端的大小.我正在使用此功能:

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什么?

python

11
推荐指数
1
解决办法
4677
查看次数

标签 统计

python ×1