def wait_ready_prefix(popen, prefix):
 emulator_ready = False
 while (not emulator_ready):
  emulator_ready = popen.stderr.readline().startswith(prefix)

def wait_ready_prefix ( popen , prefix ) : emulator_ready = False while ( not emulator_ready ) : emulator_ready = popen . stderr . readline ( ) . startswith ( prefix )
wait until the a process encounters a line with matching prefix .