title: Return a random word from a word list in python
body: <p>I would like to retrieve a random word from a file using python, but I do not believe my following method is best or efficient. Please assist.</p>
  
  <pre><code>import fileinput
  import _random
  file = [line for line in fileinput.input("/etc/dictionaries-common/words")]
  rand = _random.Random()
  print file[int(rand.random() * len(file))],
  </code></pre>