Re: [Tutor] Easy Problem

2009-09-01 Thread Luke Paireepinart
On Tue, Sep 1, 2009 at 7:46 AM, Sander Sweers wrote: > 2009/9/1 Luke Paireepinart : > txt = "Hi how are you?" > " ".join(txt.strip().split()) > > 'Hi how are you?' > > txt.strip() only remove leading and trailing white space so does > nothing in your example. It removes newline

Re: [Tutor] Easy Problem

2009-09-01 Thread Dave Kuhlman
On Mon, Aug 31, 2009 at 06:43:29PM -0700, Ishan Puri wrote: > >Hello, >I have 2 plain text documents that have uneven spacing. I need to >make these single spaced between lines and between words. Basically I >need to get them to be equal character length after I abridge the >

Re: [Tutor] Easy Problem

2009-09-01 Thread Kent Johnson
On Mon, Aug 31, 2009 at 9:43 PM, Ishan Puri wrote: > Hello, >     I have 2 plain text documents that have uneven spacing. I need to make > these single spaced between lines and between words. Basically I need to get > them to be equal character length after I abridge the uneven spacing. I don't kn

Re: [Tutor] Easy Problem

2009-09-01 Thread Sander Sweers
2009/9/1 Luke Paireepinart : txt = "Hi          how are you?" " ".join(txt.strip().split()) > 'Hi how are you?' txt.strip() only remove leading and trailing white space so does nothing in your example. However it works because txt.split() removes the excessive white space between the tex

Re: [Tutor] Easy Problem

2009-08-31 Thread Luke Paireepinart
>>> txt = "Hi how are you?" >>> " ".join(txt.strip().split()) 'Hi how are you?' On Tue, Sep 1, 2009 at 3:43 AM, Ishan Puri wrote: > Hello, > I have 2 plain text documents that have uneven spacing. I need to make > these single spaced between lines and between words. Basically I need

[Tutor] Easy Problem

2009-08-31 Thread Ishan Puri
Hello, I have 2 plain text documents that have uneven spacing. I need to make these single spaced between lines and between words. Basically I need to get them to be equal character length after I abridge the uneven spacing. In Python there is probably one simple command for this for a text