from tabulate import tabulate
mycursor.execute(qstr)
data=mycursor.fetchall()
head = ["TRAIN NO.","TRAIN NAME", "START", "DESTINATION", "TIME","DAYS", "FARE(SL)", "FARE(AC)"]
print (tabulate(data,headers = head,tablefmt = "fancy_grid",showindex=True))
Join the conversation