#!/usr/bin/python2.7 class Item: def __init__(self, xid): self.id=xid self.lvl=0 a=open("../../clientdata/items.xml", "r") swords=[] bows=[] shields=[] gid="0" rid=0 ctx=Item(0) mem=[] for l in a: if "= 2700 and rid <= 2899: shields.append(rid) elif rid >= 3500 and rid <= 3999: swords.append(rid) elif rid >= 6000 and rid <= 6499: bows.append(rid) a.close() #shields=sorted(shields, reverse=True) #bows=sorted(bows, reverse=True) #swords=sorted(swords, reverse=True) b=open("weapons.tmp", "w") b.write('\n\ \n\ \n\ \n') b.write(' \n') for i in swords: b.write(' \n' % i) b.write(' \n \n') for i in bows: b.write(' \n' % i) b.write(' \n \n') for i in shields: b.write(' \n' % i) b.write(' \n') b.close()