Name: Anonymous 2012-02-07 21:28
Python vs. Ruby
Which one is best?
Which one is best?
#!/usr/bin/env python
## usage: randomline.py file numlines
from sys import argv
import random
f=open(argv[1])
line=f.readlines()
f.close()
try: c = int(argv[2])
except: c = 1
for q in range(c): print (line[random.randint(0,len(line))-1]).strip()