Python Forum

Full Version: unexpected EOF while parsing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
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).
I am pretty new to python in general, please excuse my bad practice XD