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

Neil Cerutti mr.cerutti at
Tue Nov 19 17:42:35 CET 2013

MOn Tue, Nov 19, 2013 at 10:35 AM, Jai
<jaiprakashsingh213 at> 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"[.?!]+", line):
>         pun ="[.?!]+", 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: <>

More information about the Python-list mailing list