Showing posts with label command line options. Show all posts
Showing posts with label command line options. Show all posts

How to access command line options similar to unix commands for your python script?

import getopt
args = "--type daily --from_date 2015-12-12 --to_date 2015-12-19".split()
optlist,args = getopt.getopt(args, "", ["type=", "from_date=", "to-date"])

Fore more: https://docs.python.org/2/library/getopt.html