Skip to content

Instantly share code, notes, and snippets.

@gregorleban
Last active February 3, 2019 21:32
Show Gist options
  • Save gregorleban/bcb6e79a4c64d939791c7678a0252a3e to your computer and use it in GitHub Desktop.
Save gregorleban/bcb6e79a4c64d939791c7678a0252a3e to your computer and use it in GitHub Desktop.
[Using OptionParser] #python
```
# specify cmd-line args
from optparse import OptionParser
parser = OptionParser(usage="Usage: %prog mode [options]")
# params for downlading links
parser.add_option("-f", "--source-file", dest="sourceFile", action="store", type="string", default = None, help = "file with list of sources to analyze")
parser.add_option("-t", "--threads", dest="threads", action="store", type="int", default=30, help="number of threads used to process queue")
parser.add_option("-d", action="store_true", dest="download", help = "Download concept stats")
# parse cmd-line args
options, args = parser.parse_args()
for arg in args:
inst.computeFilteredFile(arg)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment