Skip to content

Instantly share code, notes, and snippets.

@kidpixo
Created October 8, 2021 12:38
Show Gist options
  • Save kidpixo/52c0286d95a510d28f0eac6da04d5fe8 to your computer and use it in GitHub Desktop.
Save kidpixo/52c0286d95a510d28f0eac6da04d5fe8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
"""Show table content with rich. Quick'n'dirty: no validity checks, only the fun :-D.
"""
import sys
from pandas import read_csv
from rich import print
from pathlib import Path
import os
size = os.get_terminal_size()
for p in sys.argv[1:]:
print(f"Loading file [bold green]{Path(p).name}[/bold green]", ":smiley:")
print(read_csv(p))
print('[red]'+'='*size.columns+'[/red]')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment