This is the first homework of the course "Python in the Enterprise", as requested is implemented a personal version of famous Linux "wc" command, that can be used to provide a total of the number of row, total of the number of words and total of the number of character which are in a input text.
Prerequisites
- In order to run this project is important to use python version 3 or upper.
Install it with:now check your version:$ sudo apt-get install python3
$ python --version
Basic usage
-
This project is developed to emulate Linux "wc" (Linux Word Counter)
The syntax of word counter is the follow:$ python3 wc.py <Your_File> -option
-
It is possible to count total number of row in file, adding option "-r"
$ python3 wc.py <Your_File> -r
-
It is possible to count total number of word in file, adding option "-w"
$ python3 wc.py <Your_File> -w
-
It is possible to count total number of character in file, adding option "-c"
$ python3 wc.py <Your_File> -c
-
It is possible to compute at same time all statistic, without options
$ python3 wc.py <Your_File>
-
It is possible to compute the input text that user insert by keyboard, if no text file is specified
$ python3 wc.py
Personal word counter reveals good performance also with quite large file.
-
output of computation with file almost 2GB
(18997956, 246973425, 1196871213) real 0m18.464s user 0m17.980s sys 0m0.456s
- Mario Egidio Carricato - Erasmus student AGH - other projects