On 16 March 2010 08:04, kumar s <ps_pyt...@yahoo.com> wrote:
> %cat mybigfile.rod | python x1.py
> Traceback (most recent call last):
>  File "x1.py", line 2, in <module>
>    second = raw_input()
> EOFError: EOF when reading a line
>
> How to notify that at EOF break and suppress exception.

try:
    second = raw_input()
except EOFError:
    # handle error in some way

I would probably supply the file name as an argument rather than
piping into stdin (or allow both methods), but that's up to you.

HTH,
benno
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to