Take the 2-minute tour ×

I would like to read and write to some save files with a special format. The extent of my current capabilities, however, would be to compile the go source and then call it with Python and return JSON.

Is there a better way to communicate between GO! and Python?

share|improve this question
What is wrong with json? –  Burhan Khalid Sep 11 '12 at 4:08
@BurhanKhalid, It would have to be parsed? I was just wondering if there was a better way. –  mowwwalker Sep 11 '12 at 4:13
Python's json module will do all the work of writing and parsing json files, nothing to it. –  alexis Sep 11 '12 at 13:38
any format you use will have to be parsed. Some parse faster than others but json is a perfectly respectable format for data interchange. –  Jeremy Wall Sep 11 '12 at 22:13
JSON-RPC over UDS –  tomwilde Sep 12 '12 at 7:46
show 1 more comment

2 Answers

Go has a gob format for serializing data, but some mailing list discussion on golang-nuts suggests that it's not a good choice for communicating with other languages.

JSON would be a very respectable option, or you could try using protobufs which were also suggested in the discussion I linked to above.

EDIT: You could also try communicating with Thrift depending on your needs, but that's probably a less likely candidate for what you're doing.

share|improve this answer
add comment

There is BSON, which you can think of as a binary version of JSON, with implementations for many languages including Go and Python.

share|improve this answer
add comment

Your Answer


