Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PYTHON vs. RUBY

Name: Anonymous 2012-02-07 21:28

Python vs. Ruby

Which one is best?

Name: Anonymous 2012-02-08 3:28

write this shorter in ruby or python

#!/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()

Name: Anonymous 2012-02-08 3:46

>>10
You can do that in half the lines with perl

Name: Anonymous 2012-02-08 3:48

>>10
You can do that in half the lines with perl

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List