I am working on this program in Python that would allow me to scan for a certain phrase in a certain text document. I used the finditer function in Python's re library.The certain line of code resembled the following:
phrase=regex.finditer(page)
I also had a print statement at the end that read:
print(phrase)
When I did this I got the following results:
<callable_iterator object at 0x02CF8FB0>
This is obviously not the result I want. So I tried replacing finditer with findall:
phrase=regex.findall(page)
For this the result that was printed it was:
With far more 'r's than displayed here. In the end I am trying to find a way to display all the times that that phrase occurs, individually. It would be great if this program can work anything that involves extracting phrases from text.
*NOTE*
I am a fourteen year-old novice not a computer science major, so please be careful with the explanations that you use.