Learn Enough Python to Be Dangerous: Software Development, Flask Web Apps, and Beginning Data Science with Python
by Michael Hartl
Chapter 9
Shell Scripts
In this chapter, we’ll build on the foundation laid in Section 1.4 and write three shell scripts of increasing sophistication. In the first two programs (Section 9.1 and Section 9.2), we’ll take the Python package developed in Chapter 8 and put it to work detecting palindromes drawn from two different sources: a file, and the Web. In the process, we’ll learn how to read and write from files with Python, and also how to read from a live Web URL. Finally, in Section 9.3, we’ll write a real-life utility program adapted from one I once wrote for myself. It includes an introduction to manipulation of the Document Object Model (or DOM) in a context outside a web browser.1
1. The Document Object Model was introduced (https://www.learnenough.com/css-and-layout-tutorial/introduction#sec-start_stylin ...
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.
Read now
Unlock full access