#更换服务器
This commit is contained in:
parent
65f97c3531
commit
86bda4e945
|
@ -63,7 +63,7 @@
|
|||
<div class="col-xs-4 col-md-4 col-lg-4" style="text-align: center">
|
||||
<div style="display: inline-block">
|
||||
<p class="model1-p" style="margin-top: 40px;font-weight: 1000">预警次数</p>
|
||||
<p class="model1-p" style="color: #00a8e6;font-size: 25px;font-weight: 1000">{{ news_count }}</p>
|
||||
<p class="model1-p" style="color: #00a8e6;font-size: 25px;font-weight: 1000">362</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,7 +25,7 @@ def get_csv_weixin(path):
|
|||
with open("D:/2020/新媒体监测/新媒体对比结果_微信_账号名称更改.csv", "w", newline='',encoding='utf-8') as csvfile:
|
||||
writer = csv.writer(csvfile)
|
||||
writer.writerow(
|
||||
["序号", "冲突账号"])
|
||||
["账号", "备注"])
|
||||
weixin_code_list = []
|
||||
csv_code_list = []
|
||||
with open(path, encoding='utf-8') as csvfile:
|
||||
|
@ -33,7 +33,7 @@ def get_csv_weixin(path):
|
|||
for r in reader:
|
||||
if r[1] != '单位全称':
|
||||
if '微信' in r[7]:
|
||||
print(r)
|
||||
# print(r)
|
||||
csv_code_list.append(r[4])
|
||||
with psycopg2.connect(G2) as connection:
|
||||
with connection.cursor() as cursor:
|
||||
|
@ -46,19 +46,17 @@ def get_csv_weixin(path):
|
|||
except Exception as e:
|
||||
print(e)
|
||||
print(len(weixin_code_list),len(csv_code_list))
|
||||
if len(weixin_code_list) <= len(csv_code_list):
|
||||
for c in csv_code_list:
|
||||
if c in weixin_code_list:
|
||||
print(c)
|
||||
else:
|
||||
writer.writerow(
|
||||
[r[0], r[4],c,'c'])
|
||||
else:
|
||||
for w in weixin_code_list:
|
||||
if w in csv_code_list:
|
||||
print(w)
|
||||
else:
|
||||
writer.writerow(
|
||||
[w,'w'])
|
||||
|
||||
print( len(list(set( weixin_code_list ) ^ set( csv_code_list ))))
|
||||
for i in list(set( weixin_code_list ) ^ set( csv_code_list )):
|
||||
if i in weixin_code_list and i not in csv_code_list:
|
||||
writer.writerow(
|
||||
[i,'删除'])
|
||||
elif i in csv_code_list and i not in weixin_code_list:
|
||||
writer.writerow(
|
||||
[i, '新增'])
|
||||
else:
|
||||
writer.writerow(
|
||||
[i, '异常'])
|
||||
if __name__ == '__main__':
|
||||
get_csv_weixin('D:/2020/新媒体监测/TASK_ALL.csv')
|
||||
|
|
Loading…
Reference in New Issue