Skip to content

Instantly share code, notes, and snippets.

@looopTools
Created August 31, 2015 08:06
Show Gist options
  • Save looopTools/12952aa13c7d398c9e7e to your computer and use it in GitHub Desktop.
Save looopTools/12952aa13c7d398c9e7e to your computer and use it in GitHub Desktop.
def extract_arg(input_str):
start_i = input_str.index('=') + 1
return input_str[start_i:]
def find_arg(arg, args):
for s in args:
if arg in s:
return extract_arg(s)
return None
website = 'http://127.0.0.1:4000/server'
if not find_arg('website', sys.argv) is None:
website = find_arg('website', sys.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment