Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sqlite3
- from tabulate import tabulate
- def retrieve_nth_row(rownum):
- with conn:
- data = c.execute(f"SELECT * FROM Table_name WHERE IdNum > 0 and IdNum <= (SELECT max(IdNum) FROM Anime) AND IdNum % {rownum} = 0")
- print(tabulate(data, headers="keys", tablefmt="grid", stralign='center', numalign='center')) #Prints the database as a neat table
Add Comment
Please, Sign In to add comment