code: def iseof(self):
          
          succ = windll.kernel32.PeekNamedPipe(
              self.conout_pipe, None, None, None, None, None
          )
          return not bool(succ)
docs: Check if current process streams are still open.