Parsing text

Troy trekkan at
Sun Nov 28 20:01:30 CET 1999

As you will be able to tell, I am new to Python so please forgive any newbie
things I might do. =)

What I would like to do is take a variable and parse out each of the pieces.
Most commonly delimited by spaces.  Example text:

This is a test

I would like to be able to pull out any of "This", "is", "a", "test" and be
able to drop any element into a variable that I wanted.

I hope this explains it enough.  Thanks for any help you may be able to

One other thing, is there a way to tell if a substring exists in a string?
in a basic sort of way

if 'abc' isin '123abc456'

Something to that effect anyway.

Thanks for your time!


More information about the Python-list mailing list