def METHOD_NAME(self, line):
    self.writer.Write(line+"\n")
    i = 0
    while i < 40 and not self.proc.HasExited:
        Thread.CurrentThread.Join(100)
        i += 1
    return self.proc.ExitCode