Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Last active January 7, 2020 20:06
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 ianjosephwilson/dcd0f4982c1873f9d20cd0f849682c27 to your computer and use it in GitHub Desktop.
Save ianjosephwilson/dcd0f4982c1873f9d20cd0f849682c27 to your computer and use it in GitHub Desktop.
import sys
def main(argv):
print (argv)
if __name__ == '__main__':
# The first argument is how we were called.
called_as = sys.argv[0]
# Pass actual arguments to our main function.
main(sys.argv[1:])
bobcat@liveoak ~ $ python3 export_params.py
[]
bobcat@liveoak ~ $ python3 export_params.py out.json
['out.json']
bobcat@liveoak ~ $ python3 export_params.py 1 2 3 4 5
['1', '2', '3', '4', '5']
bobcat@liveoak ~ $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment