gpt-4.1-2025-04-14· OpenAI
LMArena Human Preference 140K
Исправить код чтобы ts отображался человекочитаемо например Y.M.D HH:mm и поменять…
- User
Исправить код чтобы ts отображался человекочитаемо например Y.M.D HH:mm и поменять местами при выводе колонки тип и данные ```from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt
class EventModel(QAbstractTableModel): HEADERS = ('Время', 'Тип', 'Данные')
def __init__(self): super().__init__() self._data = [] def add_event(self, ev: dict): self.beginInsertRows(QModelIndex(), len(self._data), len(self._data)) self._data.append(ev) self.endInsertRows() # Qt overrides ------------------------------------------------------------ def rowCount(self, parent=QModelIndex()): return len(self._data) def columnCount(self, parent=QModelIndex()): return 3 def data(self, idx, role=Qt.DisplayRole): if role != Qt.DisplayRole or not idx.isValid(): return None ev = self._data[idx.row()] return (ev['ts'], ev['type'], ev['info'])[idx.column()] def headerData(self, section, orientation, role): if orientation == Qt.Horizontal and role == Qt.DisplayRole: return self.HEADERS[section]``` - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.