minor fix

This commit is contained in:
2025-07-16 11:23:25 +08:00
parent a2cb6080b0
commit 4886b18579
2 changed files with 6 additions and 3 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
.venv/
*.csv
*.bat
*.xlsx

View File

@@ -43,12 +43,12 @@ def main():
workbook = pandas.read_excel(args.input)
data = workbook.where(pandas.notnull(workbook), None).to_dict(orient='list')
recipients = data.get(args.column_address, [])
codes = data.get(args.column_code, [])
except Exception as e:
print(f'[!!!!] 读取数据表失败:{e}')
return 1
limit = len(recipients)
codes = data.setdefault(args.column_code, [None] * limit)
sents = data.setdefault(args.column_sent, [None] * limit)
print(f'[信息] 已读取联系人信息共 {limit}')
@@ -171,7 +171,9 @@ def main():
while active and index < limit:
recipient = recipients[index]
code = codes[index]
occurrence = occurrences.setdefault(code, [0])
if not code: occurrence = [0]
else: occurrence = occurrences.setdefault(code, [0])
current = index
index += 1