import time

import pandas as pd

# def writeaa():
#     detailList=[]
#     aa={
#         'id':3,
#         'name':'qqqwe'
#     }
#     detailList.append(aa)
#     writerToExcel(detailList)
# 将数据追加到excel
# def writerToExcel(detailList):
#     # filename='baidu搜索.xlsx'
#     # 读取已存在的xlsx文件
#     existing_data = pd.read_excel(filename,engine='openpyxl')
#     # 创建新的数据
#     new_data = pd.DataFrame(data=detailList)
#     # 将新数据添加到现有数据的末尾
#     combined_data = existing_data.append(new_data, ignore_index=True)
#     # 将结果写入到xlsx文件
#     combined_data.to_excel(filename, index=False)
#
# from openpyxl import Workbook
#
# if __name__ == '__main__':
#     filename='test1.xlsx'
#     # # 创建一个工作簿
#     workbook = Workbook(filename)
#     workbook.save(filename)
#     writeaa()

# gpdm = '01109.HK'
# if 'HK' in str(gpdm):
#     tmp_g = str(gpdm).split('.')[0]
#     if len(tmp_g) == 5:
#         gpdm = str(gpdm)[1:]
#         print(gpdm)
#     else:
#         pass
import redis


def check_url():
    r = redis.Redis(host="114.115.236.206", port=6379, password='clbzzsn',db=6)
    res = r.exists('WeiXinGZH:infoSourceCode','IN-20220418-0001')
    print(res)
    if res == 1:
        print('True')
    else:
        print('False')
# check_url()


def test(dic_user_count):
    dic_user_count["A"] += 1
    # print(dic_user.items())
    for key,value in dic_user_count.items():
        print(key,value)
    return dic_user_count

def test1():
    dic_user_count = {"A":0}
    for i in range(3):
        dic_user_count = test(dic_user_count)
        print(dic_user_count)


if __name__ == "__main__":
    test1()
