KeyboardInterrupt close failed in file object destructor: sys.excepthook is missing lost sys.stderr

Neil Cerutti mr.cerutti at gmail.com
Tue Nov 19 11:42:35 EST 2013


MOn Tue, Nov 19, 2013 at 10:35 AM, Jai
<jaiprakashsingh213 at gmail.com> wrote:
> please help what is this i have try lot but unable to remove it

Your code is getting into an infinite loop.

One problem is, I suspect:

> def find_position(line):
>     pun = ""
>     if re.search(r"[.?!]+", line):
>         pun = re.search(r"[.?!]+", line).group()
>     pos = line.find(pun)
>     pos = pos+len(pun)-1
>     return pos

When your search fails, this function will return 0. Fix that.

In general your problem isn't well defined enough for me to make
sense of your algorithm. Can you show sample input and output?
Can you describe the algorithm in plain English?

-- 
Neil Cerutti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20131119/3038e98c/attachment.html>


More information about the Python-list mailing list