We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adc6601 commit 7f98b18Copy full SHA for 7f98b18
utils.py
@@ -27,6 +27,8 @@ def log_title(title: str, title_len: int = TITLE_LEN):
27
@staticmethod
28
def log_to_csv(csv_name: str, field_names: tuple[str], row: dict | None = None):
29
field_names = list(map(lambda x: x.replace('_', ''), field_names))
30
+ if row is not None:
31
+ row = {k.replace('_', ''): v for k, v in row.items()}
32
if isinstance(row, dict):
33
with open(csv_name, 'a', encoding='utf-8', newline='') as file:
34
writer = csv.DictWriter(file, fieldnames=field_names)
0 commit comments