KeyboardInterrupt close failed in file object destructor: sys.excepthook is missing lost sys.stderr
mr.cerutti at gmail.com
Tue Nov 19 17:42:35 CET 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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list