minor fix
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
.venv/
|
.venv/
|
||||||
*.csv
|
*.csv
|
||||||
*.bat
|
*.bat
|
||||||
|
*.xlsx
|
||||||
@@ -43,12 +43,12 @@ def main():
|
|||||||
workbook = pandas.read_excel(args.input)
|
workbook = pandas.read_excel(args.input)
|
||||||
data = workbook.where(pandas.notnull(workbook), None).to_dict(orient='list')
|
data = workbook.where(pandas.notnull(workbook), None).to_dict(orient='list')
|
||||||
recipients = data.get(args.column_address, [])
|
recipients = data.get(args.column_address, [])
|
||||||
codes = data.get(args.column_code, [])
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'[!!!!] 读取数据表失败:{e}')
|
print(f'[!!!!] 读取数据表失败:{e}')
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
limit = len(recipients)
|
limit = len(recipients)
|
||||||
|
codes = data.setdefault(args.column_code, [None] * limit)
|
||||||
sents = data.setdefault(args.column_sent, [None] * limit)
|
sents = data.setdefault(args.column_sent, [None] * limit)
|
||||||
|
|
||||||
print(f'[信息] 已读取联系人信息共 {limit} 条')
|
print(f'[信息] 已读取联系人信息共 {limit} 条')
|
||||||
@@ -171,7 +171,9 @@ def main():
|
|||||||
while active and index < limit:
|
while active and index < limit:
|
||||||
recipient = recipients[index]
|
recipient = recipients[index]
|
||||||
code = codes[index]
|
code = codes[index]
|
||||||
occurrence = occurrences.setdefault(code, [0])
|
|
||||||
|
if not code: occurrence = [0]
|
||||||
|
else: occurrence = occurrences.setdefault(code, [0])
|
||||||
|
|
||||||
current = index
|
current = index
|
||||||
index += 1
|
index += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user