Answers for "python fancy way to get arguments from the command line"

0

python fancy way to get arguments from the command line

import optparse

parser = optparse.OptionParser()

parser.add_option('-q', '--query',
    action="store", dest="query",
    help="query string", default="spam")

options, args = parser.parse_args()

print 'Query string:', options.query
Posted by: Guest on February-26-2021

Code answers related to "python fancy way to get arguments from the command line"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language