Skip to content

Instantly share code, notes, and snippets.

@R4wm
Created June 13, 2018 21:39
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 R4wm/528231b605de9dff207540910d92fa6f to your computer and use it in GitHub Desktop.
Save R4wm/528231b605de9dff207540910d92fa6f to your computer and use it in GitHub Desktop.
#!/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