Created
August 11, 2015 21:10
-
-
Save git2samus/44947109cd1b847f72f3 to your computer and use it in GitHub Desktop.
Frases Sinergia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, random | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
print "ERROR: Se debe pasar la ruta del archivo de frases como parametro" | |
else: | |
with open(sys.argv[1]) as f: | |
frases = [text.strip() for text in f.read().split('\n') if text.strip()] | |
random.shuffle(frases) | |
print 'Presione Enter para recibir una frase o Ctrl-C para terminar' | |
try: | |
while True: | |
raw_input() | |
print frases.pop() | |
except KeyboardInterrupt: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment