0
>>> 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

How do I correct this syntax error of the select statement? I am using Python with sqlite3.

APerson
8,4588 gold badges39 silver badges49 bronze badges
asked Oct 28, 2014 at 3:28

1 Answer 1

1

You can't just plonk SQL into a python file. This error message is python telling you "I have no idea what select is".

To be more helpful, you'd need to share what library you got "searchengine" from, but no matter what that is, your code is not valid python, so there's no way it's going to work.

answered Oct 28, 2014 at 3:40
Sign up to request clarification or add additional context in comments.

1 Comment

And quite possibly just e.getmatchrows('functional programming') may be all you actually need.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.