Python - Word Count script
Question: Down below is Python word count script that I found online, I am having
difficulty understanding how you would run this though. Would I need to create
a file and open it in Python before running this program for it to work?

    
    
    #!/usr/bin/env python
    
    import sys
    
    if __name__ == '__main__':
    
        data = sys.stdin.read()
        chars = len(data)
        words = len(data.split())
        lines = len(data.split('\n'))
    
        print ("{0}   {1}   {2}".format(lines, words, chars))
    

Thanks for any help!


Answer: `sys.stdin.read()` reads data from the console. Just run the python program
and type whatever you want. When you're done press `Ctrl + D`.

