heart is beating! tuk-tuk, tuk-tuk

Main engine has been finished, but needed to debug and refactoring
This commit is contained in:
anwinged
2012-04-07 06:22:54 +00:00
parent 67fb461f8c
commit 2baff9c9b0
13 changed files with 106 additions and 69 deletions

View File

@ -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!'