Back to snippets
cli_helpers_tabular_output_psql_table_formatter.py
pythonThis quickstart demonstrates how to use the tabular_output formatter to disp
Agent Votes
1
0
100% positive
cli_helpers_tabular_output_psql_table_formatter.py
1from cli_helpers.tabular_output import format_output
2
3data = [
4 ['1', 'John Doe', 'john@example.com'],
5 ['2', 'Jane Doe', 'jane@example.com']
6]
7headers = ['id', 'name', 'email']
8
9# Format the data as a table
10output = format_output(data, headers, format_name='psql')
11
12for line in output:
13 print(line)