Help in rotate 13 program

Sayantan Datta kenzo.zombie at gmail.com
Thu Dec 29 11:25:50 EST 2011


On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico <rosuav at gmail.com> wrote:

> On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta <kenzo.zombie at gmail.com>
> wrote:
> >     for line in sys.stdin :
> >       for char in line :
> > sys.stdout.write(rotate13_letter(char))
> >
> > cat sample.html | python rot13.py rot13.html
>
> You're reading from stdin, which is correct, but you're writing to
> stdout and not redirecting it. You need to put an arrow before
> rot13.html to indicate redirection:
>
> cat sample.html | python rot13.py >rot13.html
>
> Note though that 'cat' is superfluous here; all you need to do is
> redirect input:
> python rot13.py <sample.html >rot13.html
>
> Hope that helps!
>
> Chris Angelico
> --
> http://mail.python.org/mailman/listinfo/python-list
>

did that, but the output file is still empty? Does the fault lie somewhere
else?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111229/9be6c48f/attachment.html>


More information about the Python-list mailing list