En Mon, 31 Mar 2008 11:22:40 -0300, afandi <[EMAIL PROTECTED]> escribió: > On Mar 30, 4:46 am, Gerhard Häring <[EMAIL PROTECTED]> wrote: >> >> The deluxe version with generators could look like this: >> >> def parse_logfile(): >> logf = open(...) >> for line in logf: >> if ...: >> row = (value1, value2, value3) >> yield row >> logf.close() >> >> ... >> >> cur.executemany("insert into ... values (c1, c2, c3)", parse_logfile()) > > Thanks regards to your suggestion, but I don't understand why we have > to put the IF statement?
Which if statement? The if inside parse_logfile quoted above is just an example, it's not essential. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list