Advertisement
Capuche

check_mes

Jun 8th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import os.path
  2.  
  3. f = open("map_msg.conf")
  4. table = []
  5. for line in f:
  6. if line[0] != "\n" and line[0] != "/" and line[0] != " ":
  7. table.append( line[0] )
  8. i = 1
  9. while( i < len( line ) ):
  10. if line[i].isdigit():
  11. table[ len( table ) -1 ] = table[ len( table ) -1 ] + line[i]
  12. else:
  13. break
  14. i += 1
  15.  
  16. a = set(table)
  17. suffix = [ "frn" ]
  18. g = open( "diff", "w")
  19.  
  20. for file in suffix:
  21. if os.path.isfile("map_msg_"+ file +".conf"):
  22. f = open("map_msg_"+ file +".conf")
  23. t = []
  24. for line in f:
  25. if line[0] != "\n" and line[0] != "/" and line[0] != " ":
  26. t.append( line[0] )
  27. i = 1
  28. while( i < len( line ) ):
  29. if line[i].isdigit():
  30. t[ len( t ) -1 ] = t[ len( t ) -1 ] + line[i]
  31. else:
  32. break
  33. i += 1
  34. b = set(t)
  35. union = a.union(b)
  36. intersec = a.intersection(b)
  37. Liste = list(union - intersec)
  38. g.write( file + ': ' + str( Liste ) + '\n')
  39. g.close()
  40. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement