Merge pull request #832 from GreYFoX/oypull1
[twcon.git] / scripts / dat2c.py
blob09517ca5a82ff4b468a62a4405514048aab2d1ab
1 import sys
3 data = file(sys.argv[1], "rb").read()
5 i = 0
6 print "unsigned char", sys.argv[2], "[] = {"
7 print str(ord(data[0])),
8 for d in data[1:]:
9 s = ","+str(ord(d))
10 print s,
11 i += len(s)+1
13 if i >= 70:
14 print ""
15 i = 0
16 print ""
17 print "};"