title: Mixing Python and Go
body: <p>I have been working on a library in Python and I would like to do some performance improvement.</p>
  
  <p>Is it possible to write some code in Python and some code in Go, and pass data between them?
  And if it's possible, are there any examples on how to do this?</p>
  
  <p>Like such:</p>
  
  <pre><code># Python
  def python_foo():
      data = {'foo': 'val', 'bar': [1, 2, 3]}
      go_process(json.dumps(data))
  
  
  def python_got_data_from_go(data):
      # deal with data from Go
  
  
  # Go
  func go_process(json string) {
      // do some processing
      python_got_data_from_go(someData)
  }
  </code></pre>