- 授权协议: 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
顺势而为--雷军传
采文 / 哈尔滨出版社 / 2014-9 / 29.80
主要介绍了雷军上大学开始创业到加入金山再到成为天使投资人一直最后创立小米公司的过程,以及他的“站在风口的猪”等个人名言思想的涉及。一起来看看 《顺势而为--雷军传》 这本书的介绍吧!
