Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 os.popen() 来运行一些命令。
这就是“man ls”的样子:
为什么文本显示为这样的任何想法。我尝试了 Arial 和 Consolas 字体。
帮助将是惊人的!谢谢
这些是退格字符:man尝试退格并重新打印字符以获得粗体,或下划线加退格以获得下划线。
man
man手册页说:
要获取手册页的纯文本版本,没有退格和下划线,请尝试 #人富 | col -b > foo.mantxt
要获取手册页的纯文本版本,没有退格和下划线,请尝试
#人富 | col -b > foo.mantxt
#
您还可以在 Python 中进行简单的后处理:
s = re.sub(".\x08", "", s)
这将删除第二个字符是退格的任何一对字符。