Python Forum
unexpected EOF while parsing - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: unexpected EOF while parsing (/thread-21022.html)



unexpected EOF while parsing - aaron92 - Sep-10-2019

when running this code:
import screens as scn
import inventory as inv

pressEnter = ""

scn.welcomeScreen_func()
pressEnter = input("press ENTER to continue: ")
pressEnter = 1
print(pressEnter)
I get this error:
Error:
Traceback (most recent call last): File "Main.py", line 8, in <module> pressEnter = input("press ENTER to continue: ") File "<string>", line 0 ^ SyntaxError: unexpected EOF while parsing ------------------ (program exited with code: 1) Press return to continue
I've been trying to find the issue for hours with no luck, any advice helps, thanks all


RE: unexpected EOF while parsing - scidam - Sep-11-2019

Such error usually occurs if you lost closing parenthesis, e.g.
Quote:python -c "print("

Error:
File "<string>", line 1 print( ^ SyntaxError: unexpected EOF while parsing



RE: unexpected EOF while parsing - perfringo - Sep-11-2019

Not to address the EOF problem but code logic: why you ask for user input and then overwrite it (pressEnter)? Not to mention that pressEnter is assigned to empty string to begin with (I have no idea what scn.welcomeScreen_func() does).


RE: unexpected EOF while parsing - aaron92 - Sep-11-2019

I am pretty new to python in general, please excuse my bad practice XD