Last active
October 27, 2015 05:30
-
-
Save octylFractal/73039a38c4195e52d1c5 to your computer and use it in GitHub Desktop.
random.choice for your shell
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 python3 | |
# | |
# Used for choice in shell! Do not delete. | |
# | |
import sys | |
import random | |
args = sys.argv[1:] | |
if not args: | |
print('Usage: {} <args>'.format(sys.argv[0])) | |
sys.exit(1) | |
choice = random.choice(args) | |
print(choice) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment