Christopher J. Bottaro wrote: > 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.
row = obj.ExecSQLQuery(sql, args).next() Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list