UCL / rsd-engineeringcourse

Course materials for Research Software Engineering course.
http://github-pages.ucl.ac.uk/rsd-engineeringcourse/
Other
108 stars 97 forks source link

Argparse page #95

Open mattagape opened 5 years ago

mattagape commented 5 years ago
  1. We need to explain the line: if __name__ == "__main__":

  2. what does this mean? action="store_true"

  3. (may be answer to question 2.) How do we tell it when it should expect a value after an argument and when it shouldn't? e.g. -t needs a value afterwards but -p doesn't.

ageorgou commented 5 years ago

This could do with some explanations and a link to the documentation (https://docs.python.org/3/howto/argparse.html#id1) or some examples.

For example, in addition to what Matthew suggests:

dpshelio commented 5 years ago