Re: Any algorithm to preserve whitespaces?
On 19/01/13 21:13, Santosh Kumar wrote:
> I have a working script which takes argv as an input, deassembles
> each line, and then each word. Then after it capitalizes all its word
> (upcases the first letter) and then prints it out on the stdout.
> That script does the capitalization work fine, but, when it reassemble
> the the words, it does it like this:
> lines.append(' '.join(words))
> The biggest problem is, even when the input file has many spaces, it
> strips it down to one.
words = line.split()
words = line.split(' ')
> The whole script will look clumsy here. I have put it up on GitHub,
> here is it:
In general, when the script is just this short, it's better to put it
directly on the message.
|All times are GMT. The time now is 01:04 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.