os.popen() fails when taking the program receives input on stdin

前端 未结 0 1309
情歌与酒
情歌与酒 2021-01-13 01:46

I\'m attempting to get the terminal width using the following popen call:

rows, columns = os.popen(\'stty size\', \'r\').read().split()

This works

相关标签:
回答
  • 消灭零回复
提交回复
热议问题