That worked, Thanks! Vincent Davis 720-301-3003 On Thu, Oct 15, 2015 at 6:11 AM, Peter Otten <__peter__ at web.de> wrote: > Oscar Benjamin wrote: >> > On 15 October 2015 at 09:16, Peter Otten <__peter__ at web.de> wrote: > >> > >> def preprocess(filename): > >> with open(filename) as f: > >> for row in csv.reader(f): > >> # do stuff > >> yield row > >> > >> rows = preprocess("pandas.csv") > > > > Take the with statement outside of the generator and do something like: >> When will I ever learn :( >> -- > https://mail.python.org/mailman/listinfo/python-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20151015/746cf9a3/attachment.html>