readline() 选项卡自动以大写完成并替换到位?

时间:2021-07-05 12:16:04

标签: python autocomplete readline uppercase tab-completion

使用库 PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '- (select SUM(send) as SUN1 from money_transfers where trans_type = 'inbound')' at line 1 我设法在使用 readline 时提供制表符补全。到目前为止,我的代码如下所示:

input()

如果我开始输入 import readline class TabComplete: def __init__(self, wordList): self.wordList = wordList def complete(self,text,state): results = [x for x in self.wordList if x.startswith(text)] + [None] return results[state] readline.parse_and_bind("tab: complete") tabComplete = ["IF", "IF_ELSE", "FOR", "WHILE"] completer = TabComplete(tabComplete) readline.set_completer(completer.complete) userTyped = input("prompt > ") ,然后在 I 上点击两次,它会按预期向我推荐 tabIF
我现在正在搜索的是:

  1. 如果我开始输入 IF_ELSE 然后点击两次 i 有没有办法让它仍然建议 tabIF
  2. 如果我输入 IF_ELSE,我可以实时告诉他用 IF EL 替换空格以便完成吗?

0 个答案:

没有答案
相关问题