使用库 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
上点击两次,它会按预期向我推荐 tab
和 IF
。
我现在正在搜索的是:
IF_ELSE
然后点击两次 i
有没有办法让它仍然建议 tab
和 IF
?IF_ELSE
,我可以实时告诉他用 IF EL
替换空格以便完成吗?