数据库中的file path列被切断,我还没有找到任何说明如何在python中指定列宽的文档。我正在用熊猫在终端上打印数据库。你知道吗
数据库打印输出:
Path Status Time
0 pytest_file.c Safe 2018-06-11 10:33:29
1 /Users/me/Documents/to_scan/SSpres... File Sent 2018-06-11 10:45:05
2 /Users/me/Downloads/SampleData/Eli... File Sent 2018-06-11 10:45:33
3 /Users/me/Downloads/SampleData/Eli... File Sent 2018-06-11 10:45:34
4 /Users/me/Downloads/SampleData/Lec... File Sent 2018-06-11 10:45:35
5 /Users/me/temp/ess-dive-volumes/var... Safe 2018-06-11 11:46:02
6 /Users/me/temp/ess-dive-volumes/var... Safe 2018-06-11 11:46:18
7 /Users/me/temp/ess-dive-volumes/var... Safe 2018-06-11 11:46:34
8 /Users/me/temp/ess-dive-volumes/var... Safe 2018-06-11 11:46:50
打印数据库代码:
con = sqlite3.connect(data_base)
return pd.read_sql_query('''SELECT Path, Status, Time FROM files_db''', con)
print(print_db(database))
原来熊猫是限制因素,而不是sqlite3。我通过手动将
pd.options.display.max_colwidth
设置为255
解决了这个问题。你知道吗解决这个问题的一条线是:
相关问题 更多 >
编程相关推荐