Python build compatible on both python 2 and 3
This commit is contained in:
@@ -6,11 +6,13 @@ t=str(sys.argv[1])
|
||||
|
||||
sys.stdout.write("char stdlib_" + t + "_code[] = {\n")
|
||||
|
||||
num = 0
|
||||
for line in sys.stdin:
|
||||
for c in line:
|
||||
num+=1
|
||||
sys.stdout.write("0x%0.2X, " % ord(c))
|
||||
if num%16 == 0:
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.write("0 };\n")
|
||||
width = 16
|
||||
data = sys.stdin.read()
|
||||
for i in range(0, len(data), 1):
|
||||
sys.stdout.write("0x%0.2X, " % ord(data[i:i+1]))
|
||||
|
||||
if i%width == (width-1):
|
||||
sys.stdout.write("\n")
|
||||
|
||||
sys.stdout.write("0x00 };\n\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user