Skip to content

Instantly share code, notes, and snippets.

@whutch
Created May 1, 2013 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whutch/5493242 to your computer and use it in GitHub Desktop.
Save whutch/5493242 to your computer and use it in GitHub Desktop.
A one liner for Gob's Program, with delayed text writing for maximum effect.
# Python 2.7
any(__import__('time').sleep(__import__('sys').stdout.write(chr(n)) or .01) for n in __import__('itertools').cycle([80,101,110,117,115,32])) if raw_input('Gob\'s Program: Y/N?\n? ')[0].lower() == 'y' else ''
# Python 3.x
any(__import__('time').sleep(print(chr(n),end='',flush=True) or .01) for n in __import__('itertools').cycle([80,101,110,117,115,32])) if input('Gob\'s Program: Y/N?\n? ')[0].lower() == 'y' else ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment