SCRIPT SAMPLE: 1.$ python -m nltk.downloader twitter_samples 2.$ python -c “import nltk; print(nltk.version)”
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 thesys.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 incommand
. Acommand
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