- 授权协议: MIT
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/Russell91/pythonpy
- 软件文档: https://github.com/Russell91/pythonpy/blob/master/README.rst
软件介绍
Pythonpy 可看作是命令行版的“瑞士军刀”,能在命令行中直接执行任何 Python 指令。
Usage
浮点运算
$ py '3 * 1.5' 4.5
自动导入任意模块
$ py 'math.exp(1)' 2.71828182846 $ py 'random.random()' 0.103173957713 $ py 'datetime.datetime.now?' Help on built-in function now: now(...) [tz] -> new datetime with tz's local day and time.
py -x'foo(x)'将 foo 应用到输入的每行
将输入的各行乘以7
$ py 'range(3)' | py -x 'int(x)*7' 0 7 14
抓住 csv 的第二列
$ echo $'a1,b1,c1\na2,b2,c2' | py -x 'x.split(",")[1]'
b1
b2将 “.text” 附加到目录中的每个文件
$ ls | py -x '"mv `%s` `%s.txt`" % (x,x)' | sh # sharp quotes are swapped out for single quotes # single quotes handle spaces in filenames
删除 find 命令返回的每个文件
$ find . -type f | py -x '"rm %s" % x' | sh
只获取2位数字
$ py 'range(14)' | py -x 'x if len(x) == 2 else None' 10 11 12 13
Remote
Jason Fried、David Heinemeier Hansson / Crown Business / 2013-10-29 / CAD 26.95
The “work from home” phenomenon is thoroughly explored in this illuminating new book from bestselling 37signals founders Fried and Hansson, who point to the surging trend of employees working from hom......一起来看看 《Remote》 这本书的介绍吧!
