When running the following code I would like to be able to store the returned values in a variable as a string. However when I run the code it will return the first name from the database in this format
[(u'Kiefer',)]
What would I need to change in order to just return a clean string? I was thinking I could use strip although I have never used it on a tuple (not even sure if you can) but I was hoping there is a more elegant way. Also I am using the sqlite3 module.
def search_db(self,ID,FName,LName):
#try:
FName +='%'
LName += '%'
self.cur.execute(("""SELECT FirstName FROM members WHERE FirstName LIKE '%s'\
AND LastName LIKE '%s'""") % (FName, LName))
value = (self.cur.fetchall())
print(value)
#except:
#print('failed')
cla = Database()
cla.search_db(1,'K','D')
value[0][0]is your string