how do I align all the values ββin the middle of the query result?
print('\n\nThis is my first Query in Python\n')
print(tabulate(cursor, showindex=False, headers=cursor.columns))
this is the result:
how do I align all the values ββin the middle of the query result?
print('\n\nThis is my first Query in Python\n')
print(tabulate(cursor, showindex=False, headers=cursor.columns))
this is the result:
Use numalign
argument, like this:
print('\n\nThis is my first Query in Python\n')
print(tabulate(cursor, showindex=False, headers=cursor.columns, numalign='center'))
Someone asked the same question a while ago: Pretty Printing a pandas dataframe
I will suggest you, to take a look on the last answer and also just try in your tabulate function: tablefmt='psql'