You can use the argparse module. The syntax will be a little bit different, though.
In your script, you can use the argparse module the following way:
#!/usr/bin/python
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='My awesome script doing stuff')
parser.add_argument('--list1', metavar='V1', default=[], nargs='+', help='a string for the first list')
parser.add_argument('--list2', metavar='V2', default=[], nargs='+', help='a string for the second list')
arguments = parser.parse_args()
print(arguments.list1)
print(arguments.list2)
You can then call your script:
$./run.py --list1 "one day" "one hour" --list2 "1234"
You can use nargs='*' instead of nargs='+' to allow for empty lists such as $./run.py --list1 --list2 "something" "something else" instead of forcing omitting the argument name (as in $./run.py --list2 "1234")
string.split(',')to get the list?