A Python command-line practice project for run-length encoding.
The script can:
- compress repeated letters, for example
aaabbccccto3a2b4c - decompress count-letter groups, for example
3a2b4ctoaaabbcccc - choose compression or decompression automatically from the first character of the input
compression_decompression.py- contains theDeCompressionclass and the command-line prompt
From the project folder:
python compression_decompression.pyThen enter either plain letters or a compressed count-letter string:
aaabbcccc
3a2b4c
- Multi-digit counts are supported, such as
12a. - The current input detection is simple: input starting with a digit is decompressed, and input starting with a letter is compressed.