Go语言交互式编程: Jupyter Notebook的Go内核

交互式编程是一种非常nice的编程方式。例如,Python编程就可以使用Python Shell或者IPython。Jupyter Notebook是目前最流行的支持IPython的一种工具,不仅支持Python内核,据说还支持40多种编程语言。通过安装Go内核Gophernotes,Jupyter即可支持Go语言。

在Linux下安装步骤为:

  go get -u github.com/gopherdata/gophernotes
  mkdir -p ~/.local/share/jupyter/kernels/gophernotes
  cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes

如果安装成功,执行gophernotes命令,可以看到如下提示:

$ gophernotes
2018/03/02 15:59:16 Need a command line argument specifying the connection file.

Windows或Mac系统的安装,可以参照该项目的git指引。
https://github.com/gopherdata/gophernotes

使用时,在终端输入jupyter notebook命令:

《Go语言交互式编程: Jupyter Notebook的Go内核》 Gophernotes_0.png
《Go语言交互式编程: Jupyter Notebook的Go内核》 Gophernotes_1.png

    原文作者:高稚商de菌
    原文地址: https://www.jianshu.com/p/c82a2a21afcc
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞