Skip to content

Latest commit

 

History

History

Python-Solution

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

WC Tool

The Unix command line tools are a great metaphor for good software engineering and they follow the Unix Philosophies of:

Writing simple parts connected by clean interfaces - each tool does just one thing and provides a simple CLI that handles text input from either files or file streams. Design programs to be connected to other programs - each tool can be easily connected to other tools to create incredibly powerful compositions. Following these philosophies has made the simple unix command line tools some of the most widely used software engineering tools - allowing us to create very complex text data processing pipelines from simple command line tools. There’s even a Coursera course on Linux and Bash for Data Engineering.

You can read more about the Unix Philosophy in the excellent book The Art of Unix Programming.

Installation

The functional requirements for wc are concisely described by it’s man page - give it a go in your local terminal now:

man wc

Usage

$ python3 wc.py -h                           

usage: wc.py [-h] [-v] [-f FILENAME] [-c] [-l] [-m] [-w]

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show programs version number and exit

WC Arguments:
  -f FILENAME, --filename FILENAME
                        The input file, or standard input (if no file is specified) to the standard output.
  -c, --bytes           The number of bytes in each input file is written to the standard output.
  -l, --lines           The number of lines in each input file is written to the standard output.
  -m, --characters      The number of characters in each input file is written to the standard output.
  -w, --words           The number of words in each input file is written to the standard output.

To get addtional help on a specific provider run: python wc.py -h
Exiting

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU General Public License v3.0