Real-World Python cover

Real-World Python

A Hacker's Guide to Solving Problems with Code
by Lee Vaughan
November 2020, 360 pp.

Look Inside!

Real-World PythonReal-World Python Page 64Real-World Python Page 169Real-World Python Page 193Real-World Python Page 240Real-World Python Image


You can find code files and solutions to the book's programs at its GitHub page.


With its emphasis on project-based practice, Real World Python will take you from playing with syntax to writing complete programs in no time. You’ll conduct experiments, explore statistical concepts, and solve novel problems that have frustrated geniuses throughout history, like detecting distant exoplanets, as you continue to build your Python skills.

Chapters begin with a clearly defined project goal and a discussion of ways to attack the problem, followed by a mission designed to make you think like a programmer. You’ll direct a Coast Guard search-and-rescue effort, plot and execute a NASA flight to the moon, protect access to a secure lab using facial recognition, and more. Along the way you’ll learn how to:

  • Use libraries like matplotlib, NumPy, Bokeh, pandas, Requests, Beautiful Soup, and turtle
  • Work with Natural Language Processing and computer vision modules like NLTK and OpenCV
  • Write a program to detect and track objects moving across a starfield
  • Scrape speeches from the internet and autosummarize them
  • Use the Mars Orbiter Laser Altimeter (MOLA) map to select spacecraft landing sites
  • Survive a zombie apocalypse with the aid of data-plotting and visualization tools

The book’s programs are beginner-friendly, but as you progress you’ll learn more sophisticated techniques to help you grow your coding capabilities. Once your missions are accomplished, you’ll be ready to solve real-world problems with Python on your own.

Author Bio 

Lee Vaughan is a programmer, pop culture enthusiast, educator, and author of Impractical Python Projects (No Starch Press). As a former executive-level scientist at ExxonMobil, he spent decades constructing and reviewing complex computer models, developed and tested software, and trained geoscientists and engineers.

Table of contents 

Chapter 1:Saving Shipwrecked Sailors with Bayes’ Rule
Chapter 2: Attributing Authorship with Stylometry
Chapter 3: Summarizing Speeches
Chapter 4: Sending Super-secret Messages
Chapter 5: Finding Pluto
Chapter 6: Winning the Moon Race with Apollo 8
Chapter 7: Selecting Martian Landing Sites
Chapter 8: Detecting Distant Exoplanets
Chapter 9: Identifying Friend or Foe
Chapter 10: Restricting Access with Face Recognition
Chapter 11: Escaping the Walking Dead with Data Science
Chapter 12: Are We Living in an Alien Simulation?
Appendix: Solutions to Practice Problems

View the detailed Table of Contents


"Python programmers with a little bit of experience, looking for a fun challenge that relates to real-world examples, should read [this book]."
Geek Tech Stuff

"This is the most amazing book anyone could pick up if they are unsure about what machine learning job they should focus on."
—Ian Mizer, Atlanta Python Programmers Group

"Read this book and do the work. You will find yourself building programs that address real-world problems and readying yourself to attack similarly challenging problems in whatever field you are working."
—Sandra Henry-Stocker, Linux journalist, NetworkWorld (IDG)

"I recommend this book for all Python learners!"
Kelly Paredes, Teaching Python podcast

Featured as Book of the Day at Anastasia Suen blog

Extra Stuff 

You can find code files and solutions to the book's programs at its GitHub page.


View the latest errata.