On Thu, Dec 29, 2011 at 10:09 PM, Dave Angel wrote:
> On 12/29/2011 11:25 AM, Sayantan Datta wrote:
>
>> On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico wrote:
>>
>> On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta
>>> wrote:
>>>
for line in sys.stdin :
for char in line :
>>
On 12/29/2011 11:25 AM, Sayantan Datta wrote:
On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico wrote:
On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta
wrote:
for line in sys.stdin :
for char in line :
sys.stdout.write(rotate13_letter(char))
cat sample.html | python rot13.py rot13.
On Fri, Dec 30, 2011 at 3:25 AM, Sayantan Datta wrote:
> did that, but the output file is still empty? Does the fault lie somewhere
> else?
I'm not sure if it's a copy-paste problem, but check your indentation:
your "if __name__" line seems to be indented, it should be flush left.
Indentation mak
On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico wrote:
> On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta
> 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
Sayantan Datta wrote:
> please help me, this code doesn't work,
> the output file comes out to be empty. How do i fix it? and where is it
> going wrong?
I don't know if that's a copy-n-paste error: the indentation of
> if __name__ == '__main__' :
> for line in sys.stdin :
> for char
On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta 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
On 12/29/11 11:48 AM, Sayantan Datta wrote:
cat sample.html | python rot13.py rot13.html
cat sample.html | python rot13.py > rot13.html
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as