Run python script with some of the argument that are optional
问题 I have gone through the sys documentation, however there is something that is still unclear to me. I have looked for some similar question on stackoverflow, but I haven't find anything useful (clearly any reference is appreciated!). I want to create a script - say foo.py - in which I want pass from 3 to 6 arguments: $ python foo.py arg1 arg2 arg3 The first 3 arguments must be given in any case; the last 3 arguments are used in a function that have default argument values if nothing is passed.