>>> txt = "Hi how are you?" >>> " ".join(txt.strip().split()) 'Hi how are you?'
On Tue, Sep 1, 2009 at 3:43 AM, Ishan Puri <[email protected]>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. In > Python there is probably one simple command for this for a text file? How do > I do this? > E.G.: Hi how are you? > Fixed: Hi how are you? > Thanks, > Ishan > > _______________________________________________ > Tutor maillist - [email protected] > http://mail.python.org/mailman/listinfo/tutor > >
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
