Python files compatible with python 3

This commit is contained in:
Jean-Luc Duprat
2012-01-06 16:56:09 -08:00
parent 2951589825
commit 59f4c9985e
2 changed files with 16 additions and 10 deletions

View File

@@ -4,11 +4,14 @@ import sys
t=str(sys.argv[1])
print "char stdlib_" + t + "_code[] = { "
print("char stdlib_" + t + "_code[] = { ")
num = 0
for line in sys.stdin:
for c in line:
print ord(c)
print ", "
num+=1
print("0x%0.2X, " % ord(c), end="")
if num%16 == 0:
print()
print "0 };"
print("0 };")