What does -m, -c, python, nltk.downloader stand for in the below mentioned script?

October 29, 2019 107 views
Python

Page Link: https://www.digitalocean.com/community/tutorials/how-to-work-with-language-data-in-python-3-using-the-natural-language-toolkit-nltk

SCRIPT SAMPLE:
1.$ python -m nltk.downloader twittersamples
2.$ python -c “import nltk; print(nltk.
version_)”

1 Answer

Hello,

The -m flag searches the sys.path for the named module and executes its contents as the __main__ module. Here’s a link to the official documentation that goes into more details about the -m flag:

https://docs.python.org/3/using/cmdline.html#cmdoption-m

The -c flag executes the Python code in command. A command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code. Here’s a link to the official documentation:

https://docs.python.org/3/using/cmdline.html#cmdoption-c

Hope that this helps!
Regards,
Bobby

Have another answer? Share your knowledge.