Last active
October 3, 2022 13:27
-
-
Save steph-vie/76c3d25fb10b55945eeaf92820c416a3 to your computer and use it in GitHub Desktop.
Creation d'un tableau avec le module rich
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import des modules | |
from rich.console import Console | |
from rich.table import Table | |
from rich import box | |
# Instanciation du tableau | |
console = Console() | |
table = Table("Colonne 1","Colonne 2",show_header=True, header_style="bold", title="Titre",box=box.MINIMAL) | |
# Ajout d'une ligne | |
table.add_row("Valeur 1","Valeur 2") | |
# Affichage du tableau | |
console.print(table) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment