此工具读取文件或stdin并输出随机行。
randfilter的Python项目详细描述
randfilter
此工具读取文件或stdin并输出随机行。
randfilter使用python 2.6、2.7、3.2、3.3进行测试。
要求
- python 2.6/2.7/3.2/3.3或更高版本
- docopt==0.6.1
- 模式==0.2.0
安装
从pypi安装
easy_install randfilter
或
pip install randfilter
从github安装
git clone https://github.com/ton1517/randfilter.git cd randfilter python setup.py install
使用量
randfilter Usage: randfilter (-n <num> | -p <probability>) [-u | --unorder] [-i | --ignore-empty] [<files>...] randfilter -h | --help randfilter -v | --version Options: <files>... Choose and output lines at random in files. If omitted, use stdin. -n <num> The choise number of lines. -p <probability> The choise probability of lines. The value is 0.0 to 1.0. -u --unorder Output lines are unordered. -i --ignore-empty Ignore empty line. -h --help Show this screen. -v --version Show version.