line break confusion

Sean 'Shaleh' Perry shalehperry at attbi.com
Fri Feb 15 22:30:42 EST 2002


> 
> In the string module, whitespace = ' \t\n\r\v\f' (5 characters here).
> Yet, when I run this:
>>>> import string
>>>> for c in string.whitespace:
>>>>     print '.'+ c + '.'
> 
> I get 7 results.
> What's going on here?
> 

Windows: \r\n
Linux (UNIX): \n
Mac: \r

Each OS's libs transform the sequence '\n' to whatever the right thing is for
them.




More information about the Python-list mailing list