Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #fancy #arguments #command #line
ADD COMMENT
Topic
Name
7+5 =