str2d.BoxParts
- class str2d.BoxParts(v: str, h: str, ul: str, ur: str, lr: str, ll: str, l: str, r: str, t: str, b: str, c: str)[source]
Organizes box drawing characters. Provides attribute names that are short and descriptive. This makes it easier to work with box drawing characters in code.
The tables below show the attribute names, examples, and descriptions of the parts.
Attribute Name
Example Value
Description
ul
t
ur
┌
┬
┐
Upper-leftcornerTop TcrossUpper-rightcornerl
c
r
├
┼
┤
Left TcrossCentercrossRight Tcrossll
b
lr
└
┴
┘
Lower-leftcornerBottom TcrossLower-rightcornerAttribute Name
v
h
Example Value
│
─
Description
Vertical
Horizontal
You can pass any unicode characters to the BoxParts class and it will categorize them accordingly. But the expectation would be something like the example above.
from str2d import BoxParts BoxParts( v='│', h='─', ul='┌', ur='┐', lr='┘', ll='└', l='├', r='┤', t='┬', b='┴', c='┼' )
┌─┬─┐ │ │ │ ├─┼─┤ │ │ │ └─┴─┘
Or you can pass the any characters you want to the BoxParts class and it will categorize them accordingly. In this example we use the unicode character for a full block to be all the box parts.
BoxParts(*"█"*11)
█████ █ █ █ █████ █ █ █ █████