Re: [Tutor] close failed in file object destructor:

2011-10-20 Thread Prasad, Ramit
>Thanks for your reply. Please always reply-all so a copy goes to the list, I will second this, if you do not reply all then you can only one person helping you. If you keep replying all, then any of us can jump in with our comments or suggestions. It is for your benefit, not ours ;) Ramit Ra

Re: [Tutor] logging question

2011-10-20 Thread Alex Hall
Thanks, raise should do it. I read later on last night that raise called with nothing else re-raises the last exception, but never thought of using it in my situation. On 10/20/11, Christian Witts wrote: > On 2011/10/19 09:19 PM, Alex Hall wrote: >> Hi all, >> I have never done logging before, an

Re: [Tutor] logging question

2011-10-20 Thread Christian Witts
On 2011/10/19 09:19 PM, Alex Hall wrote: Hi all, I have never done logging before, and I am wondering how it will change my script. Currently, I have something like this: for book in results: try: checkForErrors(book) except Exception, e: print e continue That way I see any errors in a

Re: [Tutor] logging question

2011-10-20 Thread Albert-Jan Roskam
Maybe something like this? I don't know what data type 'book' is, and what Exception would be raised in case someting goes wrong.import logging logging.basicConfig(filename='example.log',level=logging.ERROR) for book in results:   try:     result = process(book)     logging.info('Everything fine