|
|
|
|
 如何在raw_input输入时自动补全路径名? - linux_23 [ 2005-09-20 09:49 | 157 byte(s)]
 Re: 如何在raw_input输入时自动补全路径名? - passworld [ 2005-09-20 13:13 | 181 byte(s)]
 Re: 如何在raw_input输入时自动补全路径名? - linux_23 [ 2005-09-20 15:06 | 92 byte(s)]
 Re: 如何在raw_input输入时自动补全路径名? - linux_23 [ 2005-09-20 16:51 | 53 byte(s)]
 Re: 如何在raw_input输入时自动补全路径名? - passworld [ 2005-09-20 17:29 | 255 byte(s)]
 Re: 如何在raw_input输入时自动补全路径名? - linux_23 [ 2005-09-20 18:26 | 55 byte(s)]
 Re: 如何在raw_input输入时自动补全路径名? - linux_23 [ 2005-09-20 21:21 | 139 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
|
用readline.parse_and_bind("tab:complete")可以弄到命令名自动补全,可是好像路径名不行哦,比如/hom后按TAB键不能变成/home,要怎么设才能达到这个目的呢?
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
你要自己去做 completion,否则他怎么知道你要 complete 什么? 看 readline.set_completer() , python 的预设 completer 在 rlcompleter 里,可以参考他的源码。
|
|
|
----
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
做了个测试,发现其实是 python 的 readline binding 定制的 word_break 把路径的几个重要字符屏蔽了,你只要重设 set_completer_delims() 就可以了。
info readline 说 bash 的这项是:
"\'`@$><=;|&{(
|
|
|
----
|
|
[Original]
[Print]
[Top]
|
|
« Previous thread
请教读取有用的行 |
Python 编 程
第6页 |
Next thread »
根文件系统挂不上,romfs |
|