Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.06 KB | None | 0 0
  1. import re
  2.  
  3. Categories = ("Alliance of the Year","Most Powerful Alliance","Best Military","Best Rookie Alliance","Most Powerful Bloc","Best Flag","Most Active Alliance","Most Honorable Alliance","Best Diplomatic Team","Best Economic System","Best Recruiting Staff","Best Propagandist","Scariest Alliance","Best Alliance Growth","Best War Flag","Best Forums","Alliance Most Likely to Succeed in 2015","Most Immoral Alliance","Most Controversial Alliance","Player of the Year","Most Powerful Player","Best Alliance Leader","Most Controversial Player","Best Player Sig","Best Player Avatar","Best Poster","Nicest Player","Funniest Player","Most Active Player","Player Most Likely to Achieve Greatness in 2015","Best New Addition to the Community","Most Hated Poster","Best Declaration of War (Alliance Topic)","Best Declaration of War (in-game war screen)","Best Wall of Text","Best OWF Topic","Biggest Controversy","Funniest Event","Most Entertaining IRC Channel","Best Treaty Announcement","Worst Diplomatic Move","Best Player Quote","Best IRC Log","Largest E-Peen","Best Villain","Most Missed Player (Player that has gone inactive/quit)","Best WaterCooler Thread","Worst Alliance","Worst Sphere","Worst Poster","Most Annoying Poster","Biggest Mouth","Biggest !@#$","Quietest Power Player")
  4. lines = [line.strip() for line in open('nominations.txt')]
  5. FinalList = open('FinalNominations.txt','w')
  6.  
  7. for Category in Categories:
  8.     Nominated = []
  9.     Nominated.append("")
  10.     Nominated.append(" ")
  11.     FinalList.write("\n\n##########################\n"+Category+"\n\n")
  12.     for line in lines:
  13.         if Category in line:
  14.             Nomination = re.sub("^"+Category,'',line)
  15.             Nomination = re.sub("-",'',Nomination)
  16.             Nomination = re.sub(":",'',Nomination)
  17.             Nomination = re.sub("^ ",'',Nomination)
  18.             Nomination = re.sub(" $",'',Nomination)
  19.             Nomination.strip()
  20.             if not(Nomination in Nominated):
  21.                 FinalList.write(Nomination+"\n")
  22.                 Nominated.append(Nomination)
  23.     Nominated = []
  24.  
  25. FinalList.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement