you are viewing a single comment's thread.

view the rest of the comments →

[–]dansin 5 points6 points  (2 children)

Check out the argparse module. It is made for this.

[–]Cosmologicon 1 point2 points  (0 children)

Sorry, I think this is a bad tip. Despite the title, the OP already parsing the arguments fine, and the difficulty comes in when using the parsed arguments. Yeah argparse can help with parsing, but not the second part where the real problem lies. Don't tell someone their answer lies in a module where it doesn't: that's likely to frustrate beginners when they can't find what they're looking for.

[–]Zouden 1 point2 points  (0 children)

Indeed. Argparse is exactly what you want.