[Tutor] sqlite search

Roger rogershaw39 at hotmail.com
Fri Jan 18 19:11:18 CET 2013


Hello,

I am very new to python. Wrote a small program to use on my android phone using pickle/shelve to access  data.
That worked fine but i realised it would be better to use sqlite as a database to more easily modify the data.
I havent got a clue about sqlite, have a book but cant find the answer
My problem is this. i can access data by putting characters to search for in the program but i want it to be a variable that i can search for characters i input from keypad.
I am guessing its a syntax problem?
At the moment this works to search for everything beginning with A

sql = "SELECT * FROM plants WHERE genus LIKE 'A%'";

cursor.execute(sql);

slt =cursor.fetchone();


What i really need is to search for everything beginning with two letters from an input command
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130118/6143721d/attachment.html>


More information about the Tutor mailing list