Guest User

Untitled

a guest
Jul 21st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import sqlite3
  2. from tabulate import tabulate
  3.  
  4. def retrieve_nth_row(rownum):
  5. with conn:
  6. data = c.execute(f"SELECT * FROM Table_name WHERE IdNum > 0 and IdNum <= (SELECT max(IdNum) FROM Anime) AND IdNum % {rownum} = 0")
  7. 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