I'm working with kinterbasdb module, and the module has this function called fetchone, that returns the result of an execution of a query:
cursor.execute("....")
cursor.fetchone()
This returns a tuple: ("value1",)
, and i want access the first item, but avoiding the [0]
in the end, since doesn't tell much, it's a magic number. Is it possible? Perhaps some build in function?
I was trying to with:
value, _ = cursor.fetchone()
But this is returning: ValueError: need more than 1 value to unpack
, since the index 1 doesn't have anything.