Skip to content

Instantly share code, notes, and snippets.

Last active Jan 18, 2017
What would you like to do?
#!/usr/bin/env python
# PRACTICE PYTHON script 'Pick Word'
import random
SOWPODS_FILE = "sowpods.txt"
def random_word(filename=SOWPODS_FILE):
"""Returns a random word from a local
copy of the SOWPODS dictionary
f = open(filename, 'r')
lines = f.readlines()
return random.choice(lines).strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment