Changed output to JSON format (use double quotes)

This commit is contained in:
Sebastian Bauer 2018-12-29 18:46:24 +01:00
parent 7b4abf66a0
commit 5951a6f962
No known key found for this signature in database
GPG Key ID: B56125F4F322DDB8
2 changed files with 5 additions and 4 deletions

View File

@ -38,8 +38,9 @@ def main():
__message = subscriber.recv(zmq.NOBLOCK)
__message = zlib.decompress(__message)
__json = simplejson.loads(__message)
print __json
# call dumps() to ensure double quotes in output
print simplejson.dumps(__json)
sys.stdout.flush()
else:
print 'Disconnect from EDDN (After timeout)'

View File

@ -36,8 +36,8 @@ def main():
__message = zlib.decompress(__message)
__json = simplejson.loads(__message)
print (__json)
# call dumps() to ensure double quotes in output
print(simplejson.dumps(__json))
sys.stdout.flush()
except zmq.ZMQError as e: