My indentation apparently got et; let's try again.
import random as r
n,s=0,''
for l in open('x'):
n+=1
if r.random()<1.0/n:s=l
print s
Max wrote:
> The reasonably minimalistic python version (87 bytes), with input in a
> file named 'x':
> import random as r
> n,s=0,''
> for l in open('x'):
> n+=1
> if r.random()<1.0/n:s=l
> print s
>