Krenair

Untitled

Nov 20th, 2011
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import csv
  2. names = open('toget', 'r').read().splitlines() #list of all the MCP names we wanted to get info for
  3. rows = []
  4. classesreader = csv.DictReader(open('MCP/conf/classes.csv', 'r'), delimiter=',', quotechar='"', quoting=csv.QUOTE_ALL)
  5. for row in classesreader:
  6.     rows.append(row)
  7.  
  8. def find_notch_name(side, name, rows):
  9.     for row in rows:
  10.         if row['side'] == side and row['name'] == name:
  11.             return row['notch']
  12.     return False
  13.  
  14. print "client:"
  15. for name in names:
  16.     a = find_notch_name("0", name, rows)
  17.     if a == False:
  18.         print ""
  19.     else:
  20.         print a
  21.  
  22. print "server:"
  23. for name in names:
  24.     a = find_notch_name("1", name, rows)
  25.     if a == False:
  26.         print ""
  27.     else:
  28.         print a
Advertisement
Add Comment
Please, Sign In to add comment