def add_label(self, label_text): """添加标签到记录文件""" try: with open(self.output_file, 'a') as f: timestamp = time.strftime("%Y-%m-%d %H:%M:%S") f.write(f"\n=== LABEL [{timestamp}]: {label_text} ===\n") except Exception as e: print(f"添加标签时出错: {e}")