I have a generator that works like this:

for row in obj.ExecSQLQuery(sql, args):
        # process the row

Now there are some querys that run where I know the result will only be a
single row.  Is there anyway to get that single row from the generator
without having to use it in a for loop?  I want to do something like this:

row = obj.ExecSQLQuery(sql, args)[0]

But I'm guessing that you can't index into a generator as if it is a list.

Thank you for the help.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to