You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
303 B
Python

#!/usr/bin/python
import sys
result = 'table = {\n'
result += '\'white\' : \'black\' , \\\n'
hex_file = open(sys.argv[1], 'r')
for line in hex_file.readlines():
[ stroke, fill ] = line.split()
result += '\'#%s\' : \'#%s\', \\\n' % (fill, stroke)
result += '}'
hex_file.close()
print result