NEWLINE character problem

Jp Calderone exarkun at intarweb.us
Fri Jan 30 09:42:54 EST 2004


On Fri, Jan 30, 2004 at 04:16:12PM +0200, Dragos Chirila wrote:
> Hi
> 
> I have a string and I want to split it by NEWLINE character.
> 
> It is knowned that "Microsoft Windows, Apple's Macintosh OS and various
> UNIX, all use different characters to mark the ends of lines in text files.
> Unix uses the linefeed (ASCII character 10), MacOS uses the carriage return
> (ASCII character 13), and Windows uses a two-character sequence of a
> carriage return plus a newline". So, PLEASE don't tell me to use 'split' by
> '\n' because it won't work.

  s.splitlines()

  Jp




More information about the Python-list mailing list