私は(主に)次のコードを持っています:
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: ")
2番目のraw_inputは、EOF例外をスローします。
ret = original_raw_input(prompt)
EOFError: EOF when reading a line
これを修正する方法はありますか?複数のプロンプトを使用できませんか?