Advertisement
Guest User

Untitled

a guest
Oct 24th, 2018
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. import os
  2. from collections import Counter
  3. lst = []
  4. commands = "8ball, analyse, apystats, autojoin, away, awik, back, bargle, botfight, bothug, botslap, botsnack, bytes, calccoverage, checkMessages, chill, choose, commit, ethnologue, ety, f_weather, fcc, fight, follow, following, food, foodvote, generate, get_recent_commit, gitserver, hargle, harglebargle, harglebargleP, head, hs, hug, identlang, imdb, in, information, join, linx, listlangs, listpairs, logs, mailing list reporter, more, nightnight, noexceptions, nsfw, part, particles, perword, pester, pester stop, pesters, pointing, py, queue, quit, randquote, recent, reload, retrieve_commit, seen, slogan, stache, stats, suggest, t, tells, u, uderp, udmurt, unfollow, unsupervised, upgrade, urb, vtluug, w, wadsworth, whereis, wik, wuvt"
  5. commands = commands.split(", ")
  6. p = r"C:/Users/Nu11us/Desktop/#apertium/"
  7. for i in os.listdir(p):
  8.     a = open(p+i, errors="ignore").read()
  9.     for k in commands:
  10.         if "."+k+" " in a:
  11.             lst.append(k)
  12.         elif "begiak: "+k+" " in a:
  13.             lst.append(k)
  14.         elif "."+k+"\n" in a:
  15.             lst.append(k)
  16.         elif "begiak: "+k+"\n" in a:
  17.             lst.append(k)
  18. output = open("output.csv","w")
  19. for i in commands:
  20.     output.write(i+", "+str(lst.count(i))+'\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement