padl.print_utils

Utilities for printing.

padl.print_utils.combine_multi_line_strings(strings: List[str])

Combine multi line strings, where every character takes precedence over space. (Image space is transparent and superimposing strings on top of one another.)

Parameters

strings – list of multi-line strings

padl.print_utils.create_arrow(start_left: int, finish_right: int, n_initial_rows: int, n_final_rows: int) str

Create an ascii arrow.

Parameters
  • start_left – X-coordinate where the last line arrow ends.

  • finish_right – X-coor where the first line arrow starts.

  • n_initial_rows – Y-padding.

  • n_final_rows – Y-padding.

Example:

____________|
|
v
padl.print_utils.create_reverse_arrow(start_left: int, finish_right: int, n_initial_rows: int, n_final_rows: int)

Create an ascii arrow.

Parameters
  • start_left – X-coordinate where the last line arrow ends.

  • finish_right – X-coor where the first line arrow starts.

  • n_initial_rows – Y-padding.

  • n_final_rows – Y-padding.

Example:

____________|
|
v
padl.print_utils.format_argument(value: Any) str

Format an argument value for printing.

padl.print_utils.make_bold(x, disable=False)

Make input bold

Parameters
  • disable – If True, don’t apply formatting.

  • x – string input

padl.print_utils.make_green(x, disable=False)

Make input green

Parameters
  • disable – If True, don’t apply formatting.

  • x – string input

padl.print_utils.visible_len(value: str) int

The number of visible characters in a string.

Use this to get the length of strings that contain escape sequences.