搜索引擎的查询代码

时间:2014-10-28 03:28:04

标签: python sqlite

>>> e=searchengine.searcher('searchindex.db')

>>> e.getmatchrows('functional programming') select w0.urlid,w0.location,w1.location from wordlocation w0,wordlocation w1 where w0.urlid=w1.urlid and w0.wordid=10 and w1.wordid=17
SyntaxError: invalid syntax

# it highlights the word select in the program

如何更正select语句的语法错误?我正在使用Python和sqlite3。

1 个答案:

答案 0 :(得分:1)

您不能只将SQL插入到python文件中。此错误消息是python告诉您“我不知道选择是什么”。

为了更有帮助,你需要分享你从“searchengine”获得的库,但不管是什么,你的代码都是无效的python,所以它无法运行。