Re: groveling over a file for Q:: and A:: stmts

2012-07-24 Thread MRAB
On 24/07/2012 08:50, paul618 wrote: #!/usr/bin/env python # grep_for_QA.py I am only looking to isolate uniq Q:: and A:: stmts from my daily files # # note: This algorithm will fail if there are any blank lines within the Q and A area of interest (a paragraph) # D. Beazley is my fav document

Re: groveling over a file for Q:: and A:: stmts

2012-07-24 Thread paul618
Hi Steve: Thank you for your quick response. Ah, indeed I failed to ask my question:: Why doesnt this code print the sampledata? Instead it prints the empty list. The answer is probably quite simple, as I really am an idiot. Thanks again, paul -- http://mail.python.org/mailman/listinf

Re: groveling over a file for Q:: and A:: stmts

2012-07-24 Thread Steven D'Aprano
On Tue, 24 Jul 2012 00:50:22 -0700, paul618 wrote: > #!/usr/bin/env python > # grep_for_QA.py I am only looking to isolate uniq Q:: and A:: stmts > from my daily files # > # note: This algorithm will fail if there are any blank lines within > the Q and A area of interest (a paragraph) > > # D.

groveling over a file for Q:: and A:: stmts

2012-07-24 Thread paul618
#!/usr/bin/env python # grep_for_QA.py I am only looking to isolate uniq Q:: and A:: stmts from my daily files # # note: This algorithm will fail if there are any blank lines within the Q and A area of interest (a paragraph) # D. Beazley is my fav documentation import re, glob import pprint a