Scanning a file character by character

Hendrik van Rooyen mail at microcorp.co.za
Tue Feb 10 03:07:56 EST 2009


"Spacebar265" <spac.. at gmail.com> wrote:

>Thanks. How would I do separate lines into words without scanning one
>character at a time?

Type the following at the interactive prompt and see what happens:

s = "This is a string composed of a few words and a newline\n"
help(s.split)
help(s.rstrip)
help(s.strip)
dir(s)

- Hendrik





More information about the Python-list mailing list