Created
June 13, 2018 21:39
-
-
Save R4wm/528231b605de9dff207540910d92fa6f to your computer and use it in GitHub Desktop.
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/python | |
#Learn what sys.exit does in python | |
import sys | |
#This returns a LIST of the args passed | |
users_args = sys.argv[1:] | |
print "I see these args: ", users_args | |
#Check if the user even passed something in.. | |
if len(users_args) < 1: | |
print "Wheres my args homie??" | |
sys.exit(0) | |
######################################## | |
# Do stuff with the argument passed in # | |
######################################## | |
if users_args[0].lower() == "jeremiah": | |
print "Yeah, hes pretty cool" | |
elif users_args[0].lower() == "raymond": | |
print "dude. that guy.." | |
else: | |
print "I dont know " + users_args[0] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment