Python-Go integration

2,021 views
Skip to first unread message

ujgosw...@gmail.com

unread,
Mar 6, 2014, 2:05:07 PM3/6/14
to golan...@googlegroups.com
Can i integrate python code with Go language? If yes how can i do that?
Does Go have any good third party GUI library?

Justin Israel

unread,
Mar 7, 2014, 1:39:25 AM3/7/14
to ujgosw...@gmail.com, golang-nuts

What are you trying to do? Do you want python embedded in Go, or to communicate between python and Go applications?

On Mar 7, 2014 7:26 PM, <ujgosw...@gmail.com> wrote:
Can i integrate python code with Go language? If yes how can i do that?
Does Go have any good third party GUI library?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

goswami...@gmail.com

unread,
Mar 7, 2014, 6:17:19 AM3/7/14
to golan...@googlegroups.com, ujgosw...@gmail.com
I want to use Go for developing a Desktop application as it is much more efficient than python. But I can not find a Well supported GUI library for golang.Therefore I want to Use Python for creating GUI for the application and the rest of the coding in Go. Is it possible?

Matt Harden

unread,
Mar 7, 2014, 9:09:13 PM3/7/14
to ujgosw...@gmail.com, golang-nuts
On Thu, Mar 6, 2014 at 1:05 PM, <ujgosw...@gmail.com> wrote:
Does Go have any good third party GUI library?

It may be alpha level, but go-qml looks really promising. 

John-Alan Simmons

unread,
Mar 7, 2014, 10:47:23 PM3/7/14
to golan...@googlegroups.com, ujgosw...@gmail.com
I am using on a similar strategy for an application I am working on.

Just like you I am using python for its great cross platform GUI libraries, and use RPC calls between python and a running Go daemon

goswami...@gmail.com

unread,
Mar 8, 2014, 3:33:49 AM3/8/14
to golan...@googlegroups.com, ujgosw...@gmail.com
What do you mean by RPC call between python and go. I am a newbie and don't know about it. Please answer in detail, any learning resources etc. Any advice will be appreciated.
On Friday, March 7, 2014 12:35:07 AM UTC+5:30, ujgosw...@gmail.com wrote:

Justin Israel

unread,
Mar 8, 2014, 4:41:31 AM3/8/14
to goswami...@gmail.com, golang-nuts, ujgosw...@gmail.com
http://en.wikipedia.org/wiki/Remote_procedure_call

It's a way for one program to expose public services to other programs in a way that acts transparently like you are just calling local functions (after establishing a connection obviously). 

Lets assume you have a server in Go, and a client that wants to connect to it in Python. You go server may expose a function called Foo(val int) that takes an int and returns an int. Via some RPC mechanism, you can export your Foo() function so that your python client can connect to the server and call it. The value is serialized to some wire spec and sent to the server wrapped in some format specific to the RPC implementation. The server receives the call, executes the function with the value and transmits back the result (or communicates errors). 

Go has some built-in facilities for RPC (http://golang.org/pkg/net/rpc/) such as JSON-RPC. And then there are external options. I've been enjoying my experience thus far with Apache Thrift (http://thrift.apache.org/), and there are other options as well.  Thrift has the benefit of including a bindings generator which will generate server/client stubs for many many languages. In my situation, I have a Go client communicating with a Java server. 

This means that your python code can communicate with your Go code, over RPC, as if you were calling local python functions. 



--

Miki Tebeka

unread,
Mar 9, 2014, 10:58:24 AM3/9/14
to golan...@googlegroups.com, ujgosw...@gmail.com, goswami...@gmail.com

What do you mean by RPC call between python and go. I am a newbie and don't know about it. Please answer in detail, any learning resources etc. Any advice will be appreciated.

See http://www.artima.com/weblogs/viewpost.jsp?thread=333589, bit old but should get you there.
Reply all
Reply to author
Forward
0 new messages