1、在运行他人程序时,以下代码报错: _, term_width = os.popen('stty size', 'r').read().split() term_width = int(term_width) 2、于是查询资料了解到:这是Linux上的写法,在windows上直接设置固定值就行了,具体可以再自行搜索一下。 3、修改办法: 将该行注释,并给参数赋值即可。 # _, term_width = os.popen('stty size', 'r').read().split() term_width = 80