Python Forum

Full Version: EOF error while taking input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey there!
I had been using Eclipse IDE for python for some time now but switched to Visual Studio Code with Python extension. Just to give the IDE a test run, I ran the following code:

name = input("Please enter your name: ")
print("Hello " + name + "!")
I'm pretty sure that this would run normally in Eclipse but in Visual Studio and other IDEs, it has been giving me an EOF error. I tried replacing "input" with "raw_input" (because I read that it might help), but then I get an error saying "raw_input" isn't defined.
Please help me out with this.
Do you have a return character at the end of line 2?
Can you post the exact error? I just copied and pasted your code into VSC and it ran fine.