brisonus_data_collector/serial_logger.py
JingweiCui f7a4a23ab8 首次提交
将PC上的文件存档到远程仓库。
2025-01-07 09:07:01 +08:00

8 lines
328 B
Python

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}")