code: def spawn_i3status(self):
          
          try:
              with NamedTemporaryFile(prefix="py3status_") as tmpfile:
                  self.write_tmp_i3status_config(tmpfile)
  
                  i3status_pipe = Popen(
                      [self.i3status_path, "-c", tmpfile.name],
                      stdout=PIPE,
                      stderr=PIPE,
                      # Ignore the SIGTSTP signal for this subprocess
                      preexec_fn=lambda: signal(SIGTSTP, SIG_IGN),
                  )
  
                  self.py3_wrapper.log(
                      "i3status spawned using config file {}".format(tmpfile.name)
                  )
  
                  self.poller_inp = IOPoller(i3status_pipe.stdout)
                  self.poller_err = IOPoller(i3status_pipe.stderr)
                  self.tmpfile_path = tmpfile.name
  
                  # Store the pipe so we can signal it
                  self.i3status_pipe = i3status_pipe
  
                  try:
                      # loop on i3status output
                      while self.py3_wrapper.running:
                          line = self.poller_inp.readline()
                          if line:
                              # remove leading comma if present
                              if line[0] == ",":
                                  line = line[1:]
                              if line.startswith("[{"):
                                  json_list = loads(line)
                                  self.last_output = json_list
                                  self.set_responses(json_list)
                                  self.ready = True
                          else:
                              err = self.poller_err.readline()
                              code = i3status_pipe.poll()
                              if code is not None:
                                  msg = "i3status died"
                                  if err:
                                      msg += " and said: {}".format(err)
                                  else:
                                      msg += " with code {}".format(code)
                                  raise IOError(msg)
                  except IOError:
                      err = sys.exc_info()[1]
                      self.error = err
                      self.py3_wrapper.log(err, "error")
          except OSError:
              self.error = "Problem starting i3status maybe it is not installed"
          except Exception:
              self.py3_wrapper.report_exception("", notify_user=True)
          self.i3status_pipe = None
docs: Spawn i3status using a self generated config file and poll its output.