From 45bf4d99ac9d55b182c0aabbf9f2ae73f2c5a3f4 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 19 Oct 2011 16:14:23 -0700 Subject: [PATCH] file2json stuff --- tools/file2json.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/file2json.py b/tools/file2json.py index a1c372444..f26f28645 100644 --- a/tools/file2json.py +++ b/tools/file2json.py @@ -28,3 +28,22 @@ if len(sys.argv) < 3: else: print 'var ' + sys.argv[2] + '=' + json + ';' +''' +or (but this fails, we get a string at runtime?) + +data = open(sys.argv[1], 'r').read() +counter = 0 +print '[', +for i in range(len(data)): + last = i == len(data)-1 + print ord(data[i]), + counter += 1 + if counter % 20 == 0: + print + if counter % 1005 == 0 and not last: + print '] + [', + elif not last: print ',', + +print ']' +''' +