<br><br><div class="gmail_quote">On Thu, Dec 29, 2011 at 10:09 PM, Dave Angel <span dir="ltr"><<a href="mailto:d@davea.name">d@davea.name</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">On 12/29/2011 11:25 AM, Sayantan Datta wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico<<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>>  wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta<<a href="mailto:kenzo.zombie@gmail.com" target="_blank">kenzo.zombie@gmail.com</a>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
     for line in sys.stdin :<br>
       for char in line :<br>
sys.stdout.write(rotate13_<u></u>letter(char))<br>
<br>
cat sample.html | python rot13.py rot13.html<br>
</blockquote>
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>
<br>
cat sample.html | python rot13.py>rot13.html<br>
<br>
Note though that 'cat' is superfluous here; all you need to do is<br>
redirect input:<br>
python rot13.py<sample.html>rot13.<u></u>html<br>
<br>
Hope that helps!<br>
<br>
Chris Angelico<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
<br>
</blockquote>
did that, but the output file is still empty? Does the fault lie somewhere<br>
else?<br>
<br>
</blockquote></div></div>
Both Peter and Chris pointed out that you have the if __name__ == "__main__" line indented.  If that's true in your actual file, then the program does nothing useful.<br>
<br>
Why not run it without output redirection, and see what it displays?  And stick an unindented print line in there, just to see it do something.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
-- <br>
<br>
DaveA<br>
<br>
</font></span></blockquote></div><br><div>hmm, yes, it was, noticed it right now. Huh, i made such a silly mistake.. Anyway, thanks a lot. :)</div>