sbinet / go-python

naive go bindings to the CPython2 C-API
Other
1.52k stars 138 forks source link

How to use Py_Main function init to python3.X #95

Closed viney closed 4 years ago

viney commented 4 years ago

package main

import ( "os"

    "github.com/sbinet/go-python"

)

func init() { if err := python.Initialize(); err != nil { panic(err) } }

func main(){ rc:=python.Py_Main(os.Args) os.Exit(rc) }

default open python2.7 in ubuntu16.04

sbinet commented 4 years ago

sbinet/go-python only supports CPython2.

for CPython3, you may want to look at: https://github.com/DataDog/go-python3