In ANSI C language I can take input until the EOF in the following way,
while( scanf("%d",&number)!=EOF ) { //do something }
I have searched for the way to perform it in python. All I got was this.
while True:
try:
s=input()
print("Do something")
except EOFERROR:
break
When I execute in python I get to put an input and it prints "Do something". But I don't know the way to stop the input taking as it does in C when I press Ctrl+Z. Here It doesn't work, it keeps taking inputs. If there is a way to do it in python pressing Ctrl+Z or there is some other method to put an end, please let me know.