menduo / golang

Run go code in Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

golang

Run Go code in Python.

⚠️: WIP

install

pip install golang

or

pip install git+ssh://git@github.com/menduo/golang.git

example

run code

import golang

code = """
package main
import "fmt"

func main(){
    fmt.Println("Hello World from github.com/menduo/golang")
}
"""
golang.run_code(code)

run file

import golang

filepath = "~/ws/contrib/golang/golang/testdata/gocode/code1/main.go"
golang.run_file(filepath)

About

Run go code in Python.


Languages

Language:Python 90.8%Language:Makefile 9.2%