#!/usr/bin/env python from os import system from random import random f = open('/home/pabs/TODO') l = len(f.readlines()) f.close() line = (int)(random()*l) command = 'scite ~/TODO -goto:%s' % line system(command)