Re: [Tutor] Excited about python
Dive into Python: http://diveintopython.org/ is what you're looking for. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] Nested, line by line, file reading
Hi everyone, I have a file with this content: "1 1 1 1 1 1 1 2 1 1" I wanted a little script that would print the line containing "2" and every line containing "1" after it. I've tried this: >>> def p(): f = file("prueba.txt",'r') for startline in f.read(): if startline.find("2")