Reconstruct a URL string from sys.stdin in Python
<p>I have a script that takes input from a large log file. This file has encoded URLs.
I am using standard input to grab these URLs from the file. I wish to process each URL separately. </p>

<p>Problem is when I get the a single URL its split up into each character in the URL. I do ''.join(something) when then after processing I get characters. </p>

<p>e.g. </p>

<pre><code>for line in sys.stdin:
    line = line.strip()
    line1 = ''.join(line)
</code></pre>

<p>I also tried collecting all the characters in the URL and then joining. Still same result.</p>

<p>Sample out I get:</p>

<p>Input from file:  " www.cnn.com"
output after sys.std and processing : ['w','w','w','.','c','n','n','.','c','o','m']</p>

<p>the list appears because i make it so. Otherwise i get www.cnn.com from sys.stdin. But the underlying structure is same as the output.</p>

<p>What I want is:
Input from file:  " www.cnn.com"
output: "www.cnn.com"  (this should be one string. not strings of individual characters)</p>

<p>Thanks</p>
