str2d.Str2D.box

Str2D.box(style: ~str2d.BoxStyle | str = SINGLE
Str2D.boxROUND()
Str2D.box╭─┬─╮
Str2D.box│
Str2D.box├─┼─┤
Str2D.box│
Str2D.box╰─┴─╯ , around: bool = True) -> ~str2d.Str3D

Wrapper around box_over and box_around methods. This method will create a box around or over the data.

Parameters:
  • style (str, optional) – The style of the box, by default “single_round”.

  • around (bool, optional) – Whether to create a box around the data or over the data, by default True.

Returns:

A new Str3D object with the box around or over the data.

Return type:

Str3D

See also

box_over

Create a box over the data.

box_around

Create a box around the data.

Examples

Let’s create an instance of Str2D and assign it to the variable a and then create a box around it.

from str2d import Str2D

a = Str2D('abcdef\nghijkl\nmnopqr\nstuvwx')
a
abcdef
ghijkl
mnopqr
stuvwx
a.box()
╭──────╮
│abcdef│
│ghijkl│
│mnopqr│
│stuvwx│
╰──────╯

We can also create a box over the data.

a.box(around=False)
╭────╮
│hijk│
│nopq│
╰────╯