sys.stdin.readline() with out error check : Standard Read : Development PYTHON examples


PYTHON examples » Development » Standard Read »

 

sys.stdin.readline() with out error check




import sys, string
sum = 0

while 1:
    line = sys.stdin.readline()
    if not line: break
    sum = sum + string.atoi(line[:-1])  
print sum

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Development
» Standard Read


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0