mindquantum.io.bprint

View Source On Gitee
mindquantum.io.bprint(strings: list, align=':', title='', v_around='=', h_around='|', fill_char=' ')[source]

Print the information in block shape.

Parameters
  • strings (list[str]) – Information you want to output.

  • align (str) – The align char alone vertal direction. Default: ":".

  • title (str) – The title of this information block. Default: "".

  • v_around (str) – Vertical boundary char. Default: "=".

  • h_around (str) – horizontal boundary char. Default: "|".

  • fill_char (str) – Empty space fill with this char. Default: " ".

Returns

list, a list of formatted string.

Examples

>>> from mindquantum.io import bprint
>>> title='Info of Bob'
>>> o = bprint(['Name:Bob', 'Age:17', 'Nationality:China'],
...     title=title)
>>> for i in o:
...     print(i)
====Info of Bob====
|Name       :Bob  |
|Age        :17   |
|Nationality:China|
===================