un-tuple (newbie)

Martin Doering doeringm at gmx.de
Mon Dec 1 11:30:20 CET 2003


I want to use Jython to fetch exactly one value from a database query,
like here:

# execute a query
def query(db, sql):
    c = db.cursor()
    for line in c.fetchall():
        val = line
        print val
    return val

I could find out, how to create a tuple with just one member, but I
can not find out how to get a value from a tuple with just one member.

It will be an easy answer, I think. Sorry, it all is totally new for
me.  :-)

Martin Doering

More information about the Python-list mailing list