Skip to Content
A Concise Introduction to Programming in Python
book

A Concise Introduction to Programming in Python

by Mark J. Johnson
December 2011
Beginner
217 pages
8h
English
Chapman and Hall/CRC
Content preview from A Concise Introduction to Programming in Python
Project: File Compression
Even though storage devices continue to become larger, file compression re-
mains an important tool for everyday computer use. For example, images are
often compressed to enable faster transmission across a network or storage on
a mobile device.
A simple compression algorithm (see, e.g., [3]) for text files is based on en-
coding long strings of repeated characters. The idea is to replace a string of
repeated characters:
!!!!!!!!
with an escape sequence made up of an otherwise rare character (such as ~),
the count, and then the repeated character:
~8!
This saves space as soon as there are at least four in a row of any character. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Standard Library

Python Standard Library

Fredrik Lundh
Numerical Computing with Python

Numerical Computing with Python

Pratap Dangeti, Allen Yu, Claire Chung, Aldrin Yim

Publisher Resources

ISBN: 9781439896952