Modify the width of a tab in a format string
Is it possible to redefine the space width of a tab when printing a \t
character in python开发者_StackOverflow?
Try pydoc string.expandtabs
, I think it will do what you want.
Python's print
feature does not convert tabs to spaces - it outputs a literal tab. The way it appears depends on what program you use to view it.
精彩评论