heart is beating! tuk-tuk, tuk-tuk
Main engine has been finished, but needed to debug and refactoring
This commit is contained in:
@ -3,22 +3,27 @@
|
||||
import sys
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
|
||||
def write(msg):
|
||||
sys.stdout.write(msg + '\n')
|
||||
sys.stdout.flush()
|
||||
|
||||
def main():
|
||||
|
||||
# try:
|
||||
|
||||
d = os.path.dirname(__file__)
|
||||
os.chdir(d)
|
||||
|
||||
if sys.argv[1] == '-i':
|
||||
with open('testt.js') as f:
|
||||
with open('testt.json') as f:
|
||||
d = json.load(f)
|
||||
print json.dumps(d, indent = 2)
|
||||
write(json.dumps(d, indent = 2))
|
||||
|
||||
elif sys.argv[1] == '-r':
|
||||
textdata = raw_input()
|
||||
data = json.loads(data)
|
||||
#data = json.loads(data)
|
||||
for i in xrange(10):
|
||||
time.sleep(0.5)
|
||||
write(json.dumps({ "hello": "world" }))
|
||||
|
||||
# except:
|
||||
# print 'Error!'
|
||||
|
Reference in New Issue
Block a user