<br><br><div class="gmail_quote">On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta <<a href="mailto:kenzo.zombie@gmail.com">kenzo.zombie@gmail.com</a>> wrote:<br>
>     for line in sys.stdin :<br>
>       for char in line :<br>
> sys.stdout.write(rotate13_letter(char))<br>
><br>
</div><div class="im">> cat sample.html | python rot13.py rot13.html<br>
<br>
</div>You're reading from stdin, which is correct, but you're writing to<br>
stdout and not redirecting it. You need to put an arrow before<br>
rot13.html to indicate redirection:<br>
<div class="im"><br>
cat sample.html | python rot13.py >rot13.html<br>
<br>
</div>Note though that 'cat' is superfluous here; all you need to do is<br>
redirect input:<br>
python rot13.py <sample.html >rot13.html<br>
<br>
Hope that helps!<br>
<span class="HOEnZb"><font color="#888888"><br>
Chris Angelico<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><div>did that, but the output file is still empty? Does the fault lie somewhere else? </div>