交互式编程是一种非常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命令:


网友评论