superpollo wrote:
hi clp

what's the difference between:

while True:
    input_line = sys.stdin.readline()
        if input_line:
            sys.stdout.write(input_line.upper())
        else:
            break

and:


while True:
    try:
        sys.stdout.write(sys.stdin.next().upper())
    except StopIteration:
        break


More useless code, under the hood its working similar.
But why not use it in the way intended?

for input_line in sys.stdin:
    sys.stdout.write(input_line.upper())

?

Regards
Tino

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to