code: def _readline(self, ignore_comments=True):
          
          while True:
              line = self._det_file.readline()
              if line == '':
                  return line    # To conform the EOF behaviour of .readline()
              line = line.strip()
              if line == '':
                  continue    # white-space-only line
              if line.startswith('#'):
                  if not ignore_comments:
                      return line
              else:
                  return line
docs: The next line of the DETX file, optionally ignores comments