Here's the code so far:
#print sentences etc with word by looking for both punctuation def stuff(): word = raw_input("Put in a word!") f = open("Catcher.txt") m = f.read() while(len(m) > 0): index = m.find(word) for x in range(index, len(m)): if x is '.': i = m.index(x) m = m[x + 1: len(m)]
and heres some of the text file, so that you get an idea:
HE CATCHER IN THE RYE by J.D. Salinger TO MY MOTHER 1 If you really want to hear about it, the first thing you'll probably want to know is where I was born, an what my lousy childhood was like, and how my parents were occupied and all before they had me, and all that David Copperfield kind of crap, but I don't feel like going into it, if you want to know the truth. In the first place, that stuff bores me, and in the second place, my parents would have about two hemorrhages apiece if I told anything pretty personal about them. They're quite touchy about anything like that, especially my father. They're nice and all--I'm not saying that--but they're also touchy as hell. Besides, I'm not going to tell you my whole goddam autobiography or anything. I'll just tell you about this madman stuff that happened to me around last Christmas just before I got pretty run-down and had to come out here and take it easy. I mean that's all I told D.B. about, and he's my brother and all. He's in Hollywood. That isn't too far from this crumby place, and he comes over and visits me practically every week end.