root/galaxy-central/eggs/bx_python-0.5.0_dev_f74aec067563-py2.6-macosx-10.6-universal-ucs2.egg/EGG-INFO/scripts/random_lines.py @ 3

リビジョン 3, 296 bytes (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1#!/usr/bin/python2.6
2
3"""
4Script to select random lines from a file. Reads entire file into
5memory!
6
7TODO: Replace this with a more elegant implementation.
8"""
9
10import sys
11import random
12
13ndesired = int( sys.argv[1] )
14
15for line in random.sample( sys.stdin.readlines(), ndesired ):
16    print line,
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。