Question

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

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 twitter_samples 2.$ python -c “import nltk; print(nltk.version)”

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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