gothon从python运行go代码,只需从python导入*.go文件。
gothon的Python项目详细描述
#gothon
python 3模块编写在pure go上。没有cffi,没有ctype,没有cgo,没有pybindgen,只需从python导入`*.go'文件即可。
灵感来自[cythons`pyximport`](http://cython.readthedocs.io/en/latest/src/tutorial/cython_tutorial.html?highlight=pyximport pyximport cython compilation for developers)和[cppumport](https://github.com/tbenthompson/cppumport import-c-or-c-files-directly-from-python)。旨在使用go加快python的速度。
open repo访问任何想参与的人,请与我联系。**这是一项正在进行的工作。**
![截图](https://source.unsplash.com/fqkbxo2nkq0/850x420"示例照片,由https://unsplash.com/@sticketmule提供)
导入gothon导入并启用gothon。
>;>gothon.import_hook()
>;>import python_module导入*.go文件。
>;>repr(python_module)
<;从python_module.go>;'
>;导入gothon对象14006220608272;python_module.uu doc_u
"gothon使用ipc rpc json从python运行go代码。"
>;>;worker=python_module.start()
>;>;worker.call("echo.echo","hello from python to go")
"hello from python to go"
>;>;
```
**描述:**
gothon使用ipc rpc json从python运行go代码。
unix套接字被使用,因为从基准测试来看,它比tcp/udp套接字快3倍。
构建并缓存它自己。
此项目面向开发人员,而不是最终用户。
此项目可用于Fades、Firejails、Docker,Rkt.
本项目至少具备go编程语言的基本知识。
如果您需要在项目中集成go编程语言的帮助,请随时与我们联系。
**参数:**
-`go-file`一个go文件,用于编译并作为python模块运行,字符串类型,默认为'python_module.go',必需。
-'startup_delay'在生成go文件之后,在将ipc rpc返回到python之前,float类型的启动延迟,默认为'0.1',可选。
**关键字参数:**无。
**返回:*`gothon.rpcjsonclient()`自定义IPC RPC。
**基类:*`object`.
**类型:*`object`.
**源代码文件:**https://github.com/juancarlopaco/gothon/blob/master/gothon.py
|操作系统
;
;
/>gt;>;>;unseased=gothon()
>;>;worker=unseased.start()
>;>;worker.call("echo.echo","hello from python to go")
"hello from python to go"
>;>;worker.stop()
>;
`````
<;详细信息>;
-删除所有"pycache"和"*.pyc"。
-执行"go clean-x-cache"(通常go会自动清理缓存)。
-更新go至最新版本。
<;/详细信息>;
-https://blog.filippo.io/building-python-mo网站dules-with-go-1-5/(仅限go 1.5)
-https://github.com/go-python/gopy/issues/83(仅限python 2)
-https://github.com/go-python/gopy/blob/master/gen.go l81(仅限python 2)
-https://github.com/sbinet/go-python(仅限python 2)
-https://dustymabe.com/2016/09/13/sharing-a-go-library-to-python-using-cffi/(被篡改的模糊c上的编译器错误)
-http://pybindGen.readthedocs.io/en/latest/tutorial/(被模糊c上的编译器错误)
-https://hackernoon.com/extending-python-3-in-go-78f3a69552ac(以上全部)
-其他解决方案从go调用python,gothon的反面。
-其他我不记得的链接。
**,它有助于在搜索中更快地显示。
-[帮助](https://help.github.com/articles/using-pull-requests)和更多[帮助](https://help.github.com/articles/fork-a-repo)和交互式快速[Git教程](https://try.github.io)。
-英语是主要的默认口语,除非另有明确说明*(如不发送翻译请求)*
-欢迎通过单元测试的工作请求。
贡献意味着您同意coc。
python 3模块编写在pure go上。没有cffi,没有ctype,没有cgo,没有pybindgen,只需从python导入`*.go'文件即可。
灵感来自[cythons`pyximport`](http://cython.readthedocs.io/en/latest/src/tutorial/cython_tutorial.html?highlight=pyximport pyximport cython compilation for developers)和[cppumport](https://github.com/tbenthompson/cppumport import-c-or-c-files-directly-from-python)。旨在使用go加快python的速度。
open repo访问任何想参与的人,请与我联系。**这是一项正在进行的工作。**
![截图](https://source.unsplash.com/fqkbxo2nkq0/850x420"示例照片,由https://unsplash.com/@sticketmule提供)
导入gothon导入并启用gothon。
>;>gothon.import_hook()
>;>import python_module导入*.go文件。
>;>repr(python_module)
<;从python_module.go>;'
>;导入gothon对象14006220608272;python_module.uu doc_u
"gothon使用ipc rpc json从python运行go代码。"
>;>;worker=python_module.start()
>;>;worker.call("echo.echo","hello from python to go")
"hello from python to go"
>;>;
```
**描述:**
gothon使用ipc rpc json从python运行go代码。
unix套接字被使用,因为从基准测试来看,它比tcp/udp套接字快3倍。
构建并缓存它自己。
此项目面向开发人员,而不是最终用户。
此项目可用于Fades、Firejails、Docker,Rkt.
本项目至少具备go编程语言的基本知识。
如果您需要在项目中集成go编程语言的帮助,请随时与我们联系。
**参数:**
-`go-file`一个go文件,用于编译并作为python模块运行,字符串类型,默认为'python_module.go',必需。
-'startup_delay'在生成go文件之后,在将ipc rpc返回到python之前,float类型的启动延迟,默认为'0.1',可选。
**关键字参数:**无。
**返回:*`gothon.rpcjsonclient()`自定义IPC RPC。
**基类:*`object`.
**类型:*`object`.
**源代码文件:**https://github.com/juancarlopaco/gothon/blob/master/gothon.py
|操作系统
;
;
/>gt;>;>;unseased=gothon()
>;>;worker=unseased.start()
>;>;worker.call("echo.echo","hello from python to go")
"hello from python to go"
>;>;worker.stop()
>;
`````
<;详细信息>;
-删除所有"pycache"和"*.pyc"。
-执行"go clean-x-cache"(通常go会自动清理缓存)。
-更新go至最新版本。
<;/详细信息>;
-https://blog.filippo.io/building-python-mo网站dules-with-go-1-5/(仅限go 1.5)
-https://github.com/go-python/gopy/issues/83(仅限python 2)
-https://github.com/go-python/gopy/blob/master/gen.go l81(仅限python 2)
-https://github.com/sbinet/go-python(仅限python 2)
-https://dustymabe.com/2016/09/13/sharing-a-go-library-to-python-using-cffi/(被篡改的模糊c上的编译器错误)
-http://pybindGen.readthedocs.io/en/latest/tutorial/(被模糊c上的编译器错误)
-https://hackernoon.com/extending-python-3-in-go-78f3a69552ac(以上全部)
-其他解决方案从go调用python,gothon的反面。
-其他我不记得的链接。
**,它有助于在搜索中更快地显示。
-[帮助](https://help.github.com/articles/using-pull-requests)和更多[帮助](https://help.github.com/articles/fork-a-repo)和交互式快速[Git教程](https://try.github.io)。
-英语是主要的默认口语,除非另有明确说明*(如不发送翻译请求)*
-欢迎通过单元测试的工作请求。
贡献意味着您同意coc。