Hi folks,
I'm using os.popen() in order to run a few commands.
This is what "man ls" looks like:
Any ideas why the text is displayed as such. I tried both Arial and Consolas fonts.
Help would be amazing! Thanks
Hi folks,
I'm using os.popen() in order to run a few commands.
This is what "man ls" looks like:
Any ideas why the text is displayed as such. I tried both Arial and Consolas fonts.
Help would be amazing! Thanks
Those are backspace characters: man
is trying to backspace and reprint characters to get bolding, or underscores plus backspaces to get underlining.
The man
man page says:
To get a plain text version of a man page, without backspaces and underscores, try
#
man foo | col -b > foo.mantxt
You could also do a simple post-processing in Python:
s = re.sub(".\x08", "", s)
This removes any pair of characters where the second character is a backspace.