如何对齐查询结果中间的所有值?
print('\n\nThis is my first Query in Python\n')
print(tabulate(cursor, showindex=False, headers=cursor.columns))其结果是:
发布于 2018-08-06 18:42:49
使用numalign参数,如下所示:
print('\n\nThis is my first Query in Python\n')
print(tabulate(cursor, showindex=False, headers=cursor.columns, numalign='center'))发布于 2018-08-06 18:49:40
不久前,也有人问了同样的问题:漂亮的印刷熊猫的资料,我建议你看一下最后一个答案,然后尝试一下表格函数:tablefmt='psql'。
https://stackoverflow.com/questions/51713702
复制相似问题