str2d.Str2D.box_around

Str2D.box_around(style: ~str2d.BoxStyle | str = SINGLE
Str2D.box_aroundROUND()
Str2D.box_around╭─┬─╮
Str2D.box_around│
Str2D.box_around├─┼─┤
Str2D.box_around│
Str2D.box_around╰─┴─╯ ) -> ~str2d.Str3D

Create a box around the data. The difference between this and box_over is that this method creates a box around the data and the other method creates a box over the data. The box that is created will surround the data. This is useful when preserving the content is important.

Parameters:

style (Union[BoxStyle, str], optional) – The style of the box, by default BoxStyle.single_round.

Returns:

A new Str3D object with the box around the data.

Return type:

Str3D

See also

box_over

Create a box over the data.

box

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_around()
╭──────╮
│abcdef│
│ghijkl│
│mnopqr│
│stuvwx│
╰──────╯