Well, this is odd...
I was trying to run this script on an Ubuntu system. Gutsy 7.10
I decided to go to a WinXP system and try it with 'type' instead of 'cat'
The script worked as expected. Well, that system is a dual boot with Kubuntu Feisty Fawn. So I booted into that system and ran the scripts there. (with cat again.) This system gave me the same error as on Ubuntu.
I have one more...
User Profile
Collapse
-
That was a typing mistake. I meant EOFError.
Are you on a linux or a windows computer?
I don't know if it would make any difference. But I can't understand how it could be me.Leave a comment:
-
int(line) does not give expected results...
And it's not me. This is taken verbatim from Mark Lutz's book "Programmin g Python"
you have data.txt:
123
000
999
042
You have adder.py:
import sys
sum = 0
while True:
try:
line = raw_input()
except EORError:
break
else:
sum += int(line)
print...
No activity results to display
Show More
Leave a comment: