Skip to content

qazbnm456/py_tabwriter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTabWriter

A package for formatting text in aligned columns; inspired by Go's text/tabwriter package.

Example

>>> from py_tabwriter import TabWriter
>>> tw = TabWriter()
>>> tw.writeln('first\tsecond\tthird')
>>> tw.write('x\txx\txxx\n')
>>> tw.write(['column 1', 'column 2', 'column 3'])
>>> print(str(tw))
first    second   third
x        xx       xxx
column 1 column 2 column 3
>>> tw.alignment = 'r'
>>> print(str(tw))
   first   second    third
       x       xx      xxx
column 1 column 2 column 3

About

A Python package for formatting columns of text

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%