Python Forum
EOF error while taking input - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: General Coding Help (https://python-forum.io/Forum-General-Coding-Help)
+--- Thread: EOF error while taking input (/Thread-EOF-error-while-taking-input)



EOF error while taking input - ShishirModi - Sep-27-2020

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.
Thanks!


RE: EOF error while taking input - jefsummers - Sep-27-2020

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.