我(主要)有以下代码:
status = raw_input("Host? (Y/N) ")
if status=="Y":
print("host")
serverprozess = Process(target= spawn_server)
serverprozess.start()
clientprozess = Process (target = spawn_client)
clientprozess.start()
上面调用的方法基本上如下:
def spawn_server():
mserver = server.Gameserver()
#a process for the host. spawned if and only if the player acts as host
def spawn_client():
myClient = client.Client()
#and a process for the client. this is spawned regardless of the player's status
它工作正常,服务器生成,客户端也生成.
仅昨天,我在client.Client()中添加了以下行:
self.ip = raw_input("IP-Adress: ")
第二个raw_input引发EOF-异常:
ret = original_raw_input(prompt)
EOFError: EOF when reading a line
有没有办法解决这个问题?我不能使用多个提示吗?