Skip to content

Instantly share code, notes, and snippets.

@niyaton
Last active December 15, 2015 09:58
Show Gist options
  • Save niyaton/5241888 to your computer and use it in GitHub Desktop.
Save niyaton/5241888 to your computer and use it in GitHub Desktop.
MSDNの大量のプロダクトキーをどうにかするアレ
import sys
from lxml import etree
from itertools import count, izip
if len(sys.argv) < 2:
print 'Usage: %s filename' % ( sys.argv[0] )
exit()
doc = etree.parse(sys.argv[1])
for i, element in izip(count(1), doc.xpath('//Key')):
print '|%d|||%s|' % (i, element.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment