Python Forum
unexpected EOF while parsing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unexpected EOF while parsing
#1
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
Reply
#2
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
Reply
#3
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'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#4
I am pretty new to python in general, please excuse my bad practice XD
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  unexpected EOF while parsing dawid294 1 375 Jan-03-2024, 04:22 PM
Last Post: deanhystad
  unexpected EOF while parsing whatloop 3 8,588 Mar-09-2019, 06:59 PM
Last Post: whatloop
  SyntaxError: unexpected EOF while parsing donmerch 2 6,997 Oct-15-2018, 05:12 AM
Last Post: wavic
  unexpected output while parsing file anna 3 3,151 Apr-28-2018, 05:13 PM
Last Post: anna
  Unexpected Output after Running PArsing Script hotsea 7 4,989 Jan-10-2018, 09:55 AM
Last Post: hotsea

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020