Wednesday, 28 August 2013

Why do I get extra commas in my python slqlite SELECT results?

Why do I get extra commas in my python slqlite SELECT results?

I can't figure out what I am doing wrong. Can someone please help? When I
run the following statement:
cur.execute("SELECT created FROM datafiles where path = '%s'" %
self.srchfilepath.displayText() list = cur.fetchall()
(self.srchfilepath.displayText() is just a field on a GUI)
The results I get is:
[('testing',), ('testing',)]
The actual data is correct, it is just in a format I don't understand.
I can't figure out where the extra commas within the parens are coming
from. I am trying to put this data in back into a listbox field for
display and selection, but I need a list that the field will accept.
Clearly this is not what it wants. Can anyone tell me what I am doing
wrong and how I can make the result into something the Listbox will
accept?
Please help, Thanks

No comments:

Post a Comment