【复述】用python操作复述,集群

  

  https://blog.csdn.net/bitcarmanlee/article/details/51852126
  
  ,密码不能写到列表中去:   

     
      <李>   StrictRedisClusterstartup_nodesredis_nodes, passwordpassword   李   
     
  
  结合上一篇文章,改进脚本后操作redis-cluster
     
      <李>   root@1723147226 tmp更多/root/get_nottlpy
         李   <李>   #编码utf8
      李   <李>      李   <李>   作者:yangyi@youzan.com
      李   <李>   时间:2018/4/26下午34
      李   <李>   func:获取数据库中没有设置ttl的关键
      李   <李>   “
      李   <李>   进口复述,
      李   <李>   进口argparse
      李   <李>   导入时间
      李   <李>   导入系统
      李   <李>   进口rediscluster
      李   <李>   
      李   <李>   类ShowProcess
      李   <李>   ,,,,   李   <李>   ,,,显示处理进度的类
      李   <李>   ,,,调用该类相关函数即可实现处理进度的显示
      李   <李>   ,,,,“
      李   <李>   ,,,我0 #当前的处理进度
      李   <李>   ,,,max_steps 0 #总共需要处理的次数
      李   <李>   ,,,max_arrow 50 #进度条的长度
      李   <李>   
      李   <李>   ,,,#初始化函数,需要知道总共的处理次数
      李   <李>   ,,,def __init__self max_steps
      李   <李>   ,,,,,,,selfmax_steps max_steps
      李   <李>   ,,,,,,,selfi 0
      李   <李>   
      李   <李>   ,,,#显示函数,根据当前的处理进度我显示进度
      李   <李>   ,,,#效果为10000%
      李   <李>   ,,,def show_processself我没有
      李   <李>   ,,,,,,,我没有
      李   <李>   ,,,,,,,,,,,selfi我
      李   <李>   ,,,,,,,
      李   <李>   ,,,,,,,,,,,selfi 1
      李   <李>   ,,,,,,,num_arrow selfi selfmax_arrow/selfmax_steps #计算显示多少个
      李   <李>   ,,,,,,,num_line selfmax_arrow num_arrow #计算显示多少个
      李   <李>   ,,,,,,,百分比selfi 1000/selfmax_steps #计算完成进度,格式为xxxx %
      李   <李>   ,,,,,,,process_bar num_arrow num_line % % #带输出的字符串,表示不换行回到最左边
      李   <李>   ,,,,,,,sysstdoutwriteprocess_bar #这两句打印字符到终端
      李   <李>   ,,,,,,,sysstdoutflush
      李   <李>   
      李   <李>   ,,,def closeself单词
      李   <李>   ,,,,,,,打印
      李   <李>   ,,,,,,,印刷字
      李   <李>   ,,,,,,,selfi 0
      李   <李>   
      李   <李>   
      李   <李>   def check_ttlredis_conn no_ttl_file dbindex
      李   <李>   ,,,start_time timetime
      李   <李>   ,,,no_ttl_num 0
      李   <李>   ,,<强> <强> <强>
      李   <李>   <强> <强> <强> <强> <强> <强>
      李   <李>   <强> <强>
      李   <李>   ,,,印刷formatnumkeys_num indexdbindex
      李   <李>   ,,,process_bar ShowProcesskeys_num
      李   <李>   ,,,与openno_ttl_file f
      李   <李>   
      李   <李>   ,,,,,,,关键redis_connscan_itercount10
      李   <李>   ,,,,,,,,,,,process_barshow_process
      李   <李>   ,,,,,,,,,,,redis_connttlkey 1
      李   <李>   ,,,,,,,,,,,,,,,no_ttl_num 1
      李   <李>   ,,,,,,,,,,,,,,,no_ttl_num 10000
      李   <李>   ,,,,,,,,,,,,,,,,,,,fwritekey
      李   <李>   ,,,,,,,,,,,
      李   <李>   ,,,,,,,,,,,,,,,继续
      李   <李>   
      李   <李>   ,,,process_barclose
      李   <李>   ,,,印刷timetime start_time
      李   <李>   ,,,印刷no_ttl_num
      李   <李>   ,,,印刷% no_ttl_file

    【复述】用python操作复述,集群