Python: cree un borde de texto con tamaño dinámico

from tabulate import tabulate

text = """
some words that
could be dynamic but 
are currently static
"""

table = [[text]]
output = tabulate(table, tablefmt='grid')

print(output)




# Output:
+-----------------------+
| some words that       |
| could be dynamic but  |
| are currently static  |
+-----------------------+
corsair2014