[Tutor] returning the entire line when regex matches

Nick Burgess burgess.nick at gmail.com
Wed May 6 00:16:38 CEST 2009


forgot to add this at the top,

allfiles = []

On Tue, May 5, 2009 at 6:15 PM, Nick Burgess <burgess.nick at gmail.com> wrote:
> for root, dirs, files in os.walk('./'):
>    for f in files:
>        if f.endswith('.txt'):
>            allfiles.append(os.path.join(root, f))
>
> This returns a list of the *.txt files. Of course now I am stuck on
> how to apply the delimiter and search function to the items in the
> list..?  Any clues/examples would be great. ty
>
> On Mon, May 4, 2009 at 7:32 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>>> Mr. Gauld is referring to!!  I searched python.org and alan-g.me.uk.
>>> Does anyone have a link?
>>
>> I posted a link to the Python howto and my tutorial is at alan-g.me.uk
>> You will find it on the contents frame under Regular Expressions...
>> Its in the Advanced Topics section.
>>
>>
>> --
>> Alan Gauld
>> Author of the Learn to Program web site
>> http://www.alan-g.me.uk/
>>
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>


More information about the Tutor mailing list