×

# Taking input Python

 0 Hello, I am a rookie programmer and only recently started using CodeChef. I was testing out the CodeChef ide and realised that I got an error everytime i tried to take input on the Python ide. The error triggered for both the input() and raw_input() functions.If someone could suggest a fix or an alternative method of taking input, I'd appreciate it. My code: x = input() Error: Traceback (most recent call last): File "./prog.py", line 2, in EOFError: EOF when reading a line asked 10 May '15, 14:18 1●1●1 accept rate: 0%

 0 try to provide some input in custom input and then run answered 10 May '15, 16:56 46●3 accept rate: 0%
 0 EOF error results usually in an online judge like CodeChef when an input is given by the system but the input reading line is not at the right place to read it. Read the sample input syntax again and try. answered 26 Nov '16, 19:05 26●2 accept rate: 25%
 0 Its happen because when the compiler compile the code it get EOF at end and nothing else to do. Try using try-except method for this while True: try: a = input() except EOFError: print ("EOFError") break and you can provide some custom input also. answered 26 Nov '16, 19:20 1●1 accept rate: 0%
 0 Give the input by your own in custom input answered 08 Jan, 20:40 1 accept rate: 0%
 -1 Yeah you had not given any custom data. answered 10 May '15, 20:53 84●2●16 accept rate: 5%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×267
×169
×20

question asked: 10 May '15, 14:18

question was seen: 14,131 times

last updated: 08 Jan, 20:40