curses命令行csv和列表(表格数据)查看器
tabview的Python项目详细描述
选项卡视图
在类似电子表格的显示中查看CSV文件。
由scott hansen发布firecat4153@gmail.com>;
Original code forked from: http://www.amk.ca/files/simple/tabview.txt
Contributed by A.M. Kuchling <amk@amk.ca>
其他贡献者:
- Matus Gura <matus.gura@gmail.com>
- Nathan Typanski <ntypanski@gmail.com>
- Sébastien Celles <s.celles@gmail.com>
- Yuri D’Elia <wavexx@thregr.org>
突出显示的位置显示在屏幕的左上角;在 它显示了该单元格的内容。
特点:
- python 2.7+和3.x
- 类似电子表格的视图,用于轻松可视化表格数据
- vim-like导航(H,J,K,L,G(顶部),G(底部),12G转到第12行,M-标记, '-转到标记等)
- 切换永久标题行
- 按任意列升序或降序排序。动态更改列宽和间距
- 按“自然顺序”排序以改进数字排序
- 全文增量搜索,n和p在搜索结果之间循环
- “回车”以查看整个单元格的内容
- 将单元格内容拖至剪贴板
- 如果数据更改,文件可以重新加载到位。
- F1还是?对于键绑定
- 也可以使用来自python的命令行来可视化任何表格数据(例如 列表)
- 查看屏幕截图目录中的一些图片。
需要:
- python 2.7+或3.x
- xsel或xclip(可选-仅当“猛拉”到剪贴板时才需要)
安装:
- pip install tabview或
- # python setup.py install或
- $ python setup.py install --user或
- Archlinux AUR package
用法:
从命令行:
tabview<filename>tabview<filename>--start_pos6,5tabview<filename>+6:5(equivalenttoprevioususage)tabview<filename>--encodingiso8859-1+6:
从python命令行查看对象
importtabviewasta=[["a","b","c"],["d","e","f"]]t.view(a)
从python命令行查看文件
importtabviewastt.view(<filename>,start_pos=(60,40))
用作MySQL的传呼机。在~/.my.cnf中设置这些选项:
pager=tabview -d '\t' --quoting QUOTE_NONE - silent
测试:
- python tests/test_tabview.py
键绑定:
F1 or ? | Show this list of keybindings |
Cursor keys or h,j,k,l | Move the highlighted cell, scrolling if required. |
Q or q | Quit |
Home, ^, Ctrl-a | Move to the start of this line |
End, $, Ctrl-e | Move to the end of this line |
[num]| | Goto column <num>, or first column if num not given |
PgUp/PgDn or J/K | Move a page up or down |
H,L | Page left or right |
g | Goto top of current column |
[num]G | Goto line <num> or bottom of current column if num not given |
Ctrl-g | Show file/data information |
Insert or m | Memorize this position |
Delete or ‘ | Return to memorized position (if any) |
Enter | View full cell contents in pop-up window. |
/ | Search |
n | Next search result |
p | Previous search result |
t | Toggle fixed header row |
< > | Decrease/Increase column width (all columns) |
, . | Decrease/Increase column width (current column) |
- + | Decrease/Increase column gap |
s | Sort the table by the current column (ascending) |
S | Sort the table by the current column (descending) |
a | ‘Natural Sort’ the table (ascending) |
A | ‘Natural Sort’ the table (descending) |
# | Sort numerically by the current column (ascending) |
@ | Sort numerically by the current column (descending) |
r | Reload file/data. Also resets sort order |
y | Yank cell contents to the clipboard (requires xsel or xclip) |
[num]c | Toggle variable column width mode (mode/max), or set width to [num] |
[num]C | Maximize current column, or set width to [num] |
[num][ | Skip to (nth) change in row value (backward) |
[num]] | Skip to (nth) change in row value (forward) |
[num]{ | Skip to (nth) change in column value (backward) |
[num]} | Skip to (nth) change in column value (forward) |