Giter Site home page Giter Site logo

wgo's Introduction

wgo 类 Python 的 Golang 脚本化运行工具

wgo 是类似 Python 命令的脚本化运行工具。

预览

1

安装

可以从 releases 页面下载二进制文件运行

也可以直接安装最新版本

$ go get -u github.com/wxnacy/wgo

暂不支持 windows 平台

使用

$ wgo
>>> fmt.Println("Hello World")
Hello World

>>>

退出

<c-d> 或者输入 exit

导入包

脚本内置了一些包,包括 fmt os time strings

也可以导入新的包,就像在文件里写代码一样

>>> import "bytes"

直接输出变量

可以像 Python 命令行那样,输入变量名,直接打印

>>> t := time.Now()
>>> t
2019-03-19 17:54:36.626646507 +0800 CST m=+0.000424636

>>>

代码补全

如果想要代码补全,需要安装 gocode

$ go get -u github.com/mdempsky/gocode

现在的代码补全功能,如果当行代码比较复杂,需要在想要补全的报名前加一个空格,这不影响代码输出,只是稍微有点别扭,比如:

wgo1

更新日志

HISTORY

wgo's People

Contributors

wxnacy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.