Hello, I’m working on some scripts in Python for the UE editor. Right now I’ve been succesfull with some scripts, like loading assets and replacing actors in the map level.
Now I’m trying to output a console menu, so I can launch some functions from the Cmd console, failing over and over. Can you guys help me ?
Here’s the code:
def sayHello():
print("Hello World")
def quitMenu():
return
inputKey = -1
switcher = {
1: sayHello,
0: quitMenu
}
while inputKey != 0:
print("
Welcome to a Python menu, select an option:")
print("0: Quit")
print("1: Say hello")
inputKey = int(raw_input())
func = switcher[inputKey]()
And this is the error message I’m getting all the time.
LogPython: Error: EOFError: EOF when reading a line
Replies would be much appreciated!
PS: I saw another comment with the same issue, however I’m using v4.20 and isn’t working anyways.