vert_join

  • full name: tenpy.tools.string.vert_join

  • parent module: tenpy.tools.string

  • type: function

tenpy.tools.string.vert_join(strlist, valign='t', halign='l', delim=' ')[source]

Join strings with multilines vertically such that they appear next to each other.

Parameters
strlistlist of str

the strings to be joined vertically

valing't', 'c', 'b'

vertical alignment of the strings: top, center, or bottom

halign'l', 'c', 'r'

horizontal alignment of the strings: left, center, or right

delimstr

field separator between the strings

Returns
joinedstr

a string where the strings of strlist are aligned vertically

Examples

>>> print vert_join(['a\nsample\nmultiline\nstring', str(np.arange(9).reshape(3, 3))],
...                 delim=' | ')
a         | [[0 1 2]
sample    |  [3 4 5]
multiline |  [6 7 8]]
string