Guest User

Untitled

a guest
Mar 15th, 2013
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. # Make list of items from NEI dump
  2. # You will have to remove the last trailing comma
  3. # and add the items = {} part
  4.  
  5. IDDump = open("IDDump.txt","r") # IDDump from NEI
  6. f = open("listdump.txt", "a")
  7. for index, key in enumerate(IDDump.readlines()):
  8.     try:
  9.         index = index + 1
  10.         temp = key.split(" ")
  11.         if temp[1] == "Unused":
  12.             pass
  13.         else:
  14.             temp = temp[2]
  15.             temp = temp.rstrip(".")
  16.             f.write('[' + str(index) + ']' + '="' + temp + '",\n')
  17.  
  18.     except:
  19.         pass
Advertisement
Add Comment
Please, Sign In to add comment