los*_*eek 4 python history readline tab-completion
有没有一种方法可以使用raw_input而不在readline历史记录中留下一个符号,这样它就不会在tab完成时显示?
你可以做一个类似的功能
import readline
def raw_input_no_history():
input = raw_input()
readline.remove_history_item(readline.get_current_history_length()-1)
return input
Run Code Online (Sandbox Code Playgroud)
并调用该函数而不是raw_input.您可能不需要减1取决于您从哪里调用它.
归档时间: |
|
查看次数: |
1965 次 |
最近记录: |