@saurabh: exceptions are not returned, they are raised.

and if you are using python2.5 (even 2.7 has lost support for it) use:

from sys import stdin

now stdin can be read as a file. So, you can have
stdin.readline
       .readlines
       .read

They all read only till EOF


On Nov 18, 5:48 pm, saurabh singh <saurab...@gmail.com> wrote:
> Though its obvious but still to add an explanation to complete the
> response.On detecting EOF EOFError is exception is returned.I am catching
> that using pythons exception handling(just like try catch in c++).In except
> block u can include the operations that should be performed on catching
> EOF.Hope the answer is complete enough
>
>
>
>
>
>
>
>
>
> On Fri, Nov 18, 2011 at 6:10 PM, saurabh singh <saurab...@gmail.com> wrote:
>
> > try:
> > while 1:
> > i=input()
> >  print i
> > except EOFError:
> > a=''
>
> > One possible way......dont know if there are other elegant ways of doing
> > the same.
>
> > --
> > Saurabh Singh
> > B.Tech (Computer Science)
> > MNNIT ALLAHABAD
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to