On Fri, 1 Oct 2010 08:49:31 am Alex Hall wrote:

> Ah-ha!!
> re.split(r"\n+", self.original)
> That did it, and my program once again runs as expected. Thanks!

There is no need to crack that tiny peanut with the 40 lb sledgehammer 
of a regular expression.

list_of_lines = string.split('\n')

Much faster, simpler, and does the job. To get rid of empty lines:

list_of_lines = filter(None, string.split('\n'))




-- 
Steven D'Aprano
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to