[Tutor] just what does read() return?
mehgcap at gmail.com
Fri Oct 1 00:49:31 CEST 2010
On 9/30/10, Walter Prins <wprins at gmail.com> wrote:
> On 30 September 2010 23:32, Alex Hall <mehgcap at gmail.com> wrote:
>> txt=str(self.original).split(r"\n+") #create an array where elements
> OK, consider this Python shell session:
>>>> s = "line1\nline2"
> ['line1', 'line2']
> Hmm, so split doesn't like that seperator.
> Taking a step back -- It looks like you're trying to specify a regular
> expression as a split string. A string object's split method doesn't
> support regular expressions. The split function in the "re" module however
That did it, and my program once again runs as expected. Thanks!
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap
More information about the Tutor