Python-based on the UUID to get the number of requests to redo various actions

Source: Internet
Author: User
Tags uuid

#!/usr/bin/python# -*- coding: utf-8 -*-#RUN      //  Program Start # exit    //  program exits #start   //  hotspot start #stop    //   Hotspot Stop #onl     //  Client online #offl    //  client offline #install  //Install #uninstall //uninstall import re# mode match Uuidpatternuid=re.compile (R ' (\w) {8}-(\w) {4}-(\w) {4}-(\w) {4}-( \w) {#定义Uid字典), used to drain uid={} #用来统计各种动作的次数actionCount ={     "A=run":0,      "A=exit":0,     "A=start":0,     "A=stop":0,      "a=onl":0,     "A=offl":0,     "A=install":0,      "A=uninstall": 0}for k,v in actioncount.iteritems ():     with open ("C:/users/administrator/desktop/python/result.txt")  as f:         for line in&nbsP;f:            if patternuid.search (line):                 uidname= Patternuid.search (line) group ()                  if k in line:                     if uid.has_key (UidName):                          pass                     else:                         uid[uidName]=1                          actioncount[k]+= 1for k,v in actioncount.iteritems ():     print k ,actioncount[k]


This article is from the "Record Drip" blog, please be sure to keep this source http://caozm.blog.51cto.com/1118764/1584955

Python-based on the UUID to get the number of requests to redo various actions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.