Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

Impractical Python Projects: Playful Programming Activities to Make You Smarter

Rate this book
Impractical Python Projects is a collection of fun and educational projects designed to entertain programmers while enhancing their Python skills. It picks up where the complete beginner books leave off, expanding on existing concepts and introducing new tools that you'll use every day. And to keep things interesting, each project includes a zany twist featuring historical incidents, pop culture references, and literary allusions.

You'll flex your problem-solving skills and employ Python's many useful libraries to do things
- Help James Bond crack a high-tech safe with a hill-climbing algorithm
- Write haiku poems using Markov Chain Analysis
- Use genetic algorithms to breed a race of gigantic rats
- Crack the world's most successful military cipher using cryptanalysis
- Derive the anagram, "I am Lord Voldemort" using linguistical sieves
- Plan your parents' secure retirement with Monte Carlo simulation
- Save the sorceress Zatanna from a stabby death using palingrams
- Model the Milky Way and calculate our odds of detecting alien civilizations
- Help the world's smartest woman win the Monty Hall problem argument
- Reveal Jupiter's Great Red Spot using optical stacking
- Save the head of Mary, Queen of Scots with steganography
- Foil corporate security with invisible electronic ink

Simulate volcanoes, map Mars, and more, all while gaining valuable experience using free modules like Tkinter, matplotlib, Cprofile, Pylint, Pygame, Pillow, and Python-Docx.

Whether you're looking to pick up some new Python skills or just need a pick-me-up, you'll find endless educational, geeky fun with Impractical Python Projects.

424 pages, Paperback

Published November 27, 2018

140 people are currently reading
551 people want to read

About the author

Lee Vaughan

4Ìýbooks10Ìýfollowers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
38 (44%)
4 stars
30 (35%)
3 stars
15 (17%)
2 stars
2 (2%)
1 star
0 (0%)
Displaying 1 - 12 of 12 reviews
Profile Image for Ian Mizer.
8 reviews1 follower
December 19, 2020
The first introduction that you read about python should teach you the base language. This book is here to teach you all of the things that can be done with that language and how to make it better. This might be a gold standard in Python educational material. A must have second book for every developer that ever wants to learn python as a language. The book starts out teaching the reader about linting, doc strings, and pep guidelines as a chapter one. Something that all senior developers consider important things to learn, but often something that books never teach. Because of this I will have to spend a long time in the bonus points section. So come along with me in my wonderful python journey reading “Impractical Python Projects�

Ok, are they gone? I think I got rid of all the people who will only look at the highlight sentences. So now I’m going to sit down and go through all the actual pieces of this book and explain my system. I rated this book on 3 main subjects:

Readability: How easy is this book to read and how quickly could a person finish the whole book

Accuracy: how accurate is the book? How many errors does it make in the code or text?

Subject: Does this book do what the cover or back says it does? Is what the book wants to teach you good?

Bonus Points: This is just for outside resources that the book points to directly. I might also add some places where you can find more education from the author such as informative twitter threads or medium articles that the author offers for free.


Readability 9 out of 10:
This books readability comes from the fact that a lot of it’s projects are quick and fun. Most of the things listed within this book are projects you might actually do if you weren’t getting paid to write code. Because of this I found that I actually wanted to read deeper into the book and get past the important concepts that it was going over. The concepts tend to slow it down the books readability considerably, but because of fun projects I wasn’t bored with the conversations the author was trying to have. Because of this you don’t often reach those slowdown points long or often enough to notice that they are actually slowing you down. There placement is often handy because it takes time to show you where you might be able to expand this particular project.

Accuracy 10 out of 10:
This book intentionally tells you when it’s not doing best practices in order to meet the impractical or fun parts of its code. The great thing this author has decided to do is make sure that it tells you when these are bad practices that should be avoided. Practices like not using pylint or flake8 to look over your code. Doing this will help you see similar code in the future and know what to do to fix it or improve it’s overall quality.

Subject 10 out of 10:
This book does exactly what it says it’s going to do “Give you python projects that aren’t practical� Between creating your own funny name or haiku generator, Breeding an army of super rats, and simulating Alien Volcanoes I can say that I had fun with this book. The main draw will be the fact that you could jump around this book taking projects that sound interesting to you and still get something out of it. This book offers 24 interesting projects in total and most of those projects can be stand alone, allowing you to do them without having to start at page x and y. The more advanced projects are in the back half of the book and the projects that focus on the standard library can be found in the front half. The book doesn’t even ask you to rely on major libraries like Scipy or NLTK until almost 150 pages in. This is nice as it might ask you to use libraries that you wouldn’t normally think about or use in your daily work environment. It will also provide a challenge at the end of every chapter as a summary of sorts to do on your own. This is to make sure that you can actually take this information and run with it.



Bonus Points:

+1 To doing a good job staying inside of the standard library:
This book about python doesn’t have the reader move outside of python until almost half the projects in the book are done. In fact the book doesn’t lean on imported libraries until the 15th project of 24 ,when it has to use them in order to properly work with natural language processing. It even goes through some more advanced topics like creating algorithms with just the python standard library. This can show people how python can be used as a general purpose language rather than just a base for whatever they’re going to import. Because of this the author gets kudos from me.

+2 to the further reading sections:
When you complete many of these projects you will find a section called “further reading� this section is just a way for the author to provide you with more. Whether that’s other books to read, more data to use, or information on why hash tables can be efficient this book offers it up. I always love when a book can give more than it’s pages are worth by throwing more opportunities to educate yourself. I give 2 bonus points to this book because it has this in spades while still providing you with about 350 pages of good exercises and education.
Profile Image for William Schram.
2,239 reviews94 followers
July 19, 2020
Impractical Python Projects is a book written for a middle-range programmer. You have a few programs under your belt, you know most of the programming basics, and now you want to have a bit of a challenge. The book itself is a fertile ground for writing fun programs, giving tons of ideas and pieces of advice.

I say the book is for the middle-range programmer for one reason; it expects you to be able to do a lot of basic things without the instructions holding your hand or giving step-by-step instructions. While it is possible to look at their solutions, I feel that it is more fun to figure it out yourself.

The book has sixteen topics with twenty-four projects spread throughout the chapters. There are a lot of different things you can do with Python, and this book illustrates that fact.

So the book follows a simple premise; each chapter opens with an introduction to a problem. The book then tells you to solve this problem using your programming chops. You might have to generate a list of silly names. Maybe solving cryptograms is more to your taste. Throughout the book, you can find interesting projects that apply programming skills.

My favorite projects include the Monty Hall Problem project where you have to verify what Marilyn Vos Savant wrote back in 1990 and a project where you have to use Markov Chain Monte Carlo methods to write a program that can generate a Haiku. There is a project that utilizes Benford's Law as well.

So this book is excellent. It covers several mathematical and programming ideas and does so with a sense of fun.
9 reviews1 follower
June 29, 2020
I started learning Python with "Python for the Absolute Beginner" and liked the project- and game-based style of that book. I bought Impractical Python Projects because it followed that style, more-or-less. It was a good decision. There's a whole lot of stuff left out of the beginner book. I learned this quickly when I started trying to write my own programs and visited help sites like Stackoverflow. Impractical Python has filled in a lot of those gaps. This is where I learned about linting, profiling, and logging my code. I've also gotten a taste of more advanced modules like matplotlab (for charting) and numpy (numerical python). I appreciate that the use cases are in working programs where the modules have practical applications, vs. just short examples of the syntax.

There are 24 main projects and lots of practice projects with solutions. The author walks you through the design strategy and pseudocode for each main project, which I really appreciated. A big difference between this book and online tutorials is that there are no "code dumps" and there's a lot of discussion of the problem domain. You can skip this if you want, and go straight to the code, but I think it's good for beginners plus I learned a lot of arcane knowledge on a range of subjects like astronomy, finance, space travel, cryptography, etc. And the detailed code description is especially helpful with function parameters. These are described in the text, so you don't have to go off and google the function docs to figure out what all the arguments and "magic numbers" refer to.

My favorite project was "Finding Voldemort" in Chapter 3, where you use cryptography to tease out "I am Lord Voldemort" from "Tom Marvolo Riddle". I'm a big Potter fan, but I would've liked this anyway. That you can so easily find a word (Voldemort) that's not a real word, and that you (pretend) you don't know you're looking for, is amazing.

I also like the chapter on genetic algorithms. Using them to breed giant rats and crack safes really brought home how they work. The syllable-counting project was also really interesting, I almost skipped this one but I'm glad I didn't. This opened my eyes to natural language processing. The final chapter on Benford's Law was cool; I had never heard of this before, and I like the way the author related it to the 2016 election.

Another fave was building a model of the Milky Way galaxy. Generating the simulations was addictive.

I've now bought another No Starch book, "Automate the Boring Stuff with Python," and have found it really useful, as well.
Profile Image for Steven Robertson.
85 reviews2 followers
March 4, 2021
Very good book. I enjoyed it. When the first project is a random Gus nickname generator (from the show Psych, you know good things are in store.

Each chapter walks through a concept and talks through the code for that project. The chapter ends with either Practice Projects (whose answers are included in the downloadable materials) and Challenge Projects (whose answers are not).

I was able to do some of the Practice and Challenge Projects on my own, and some I would never have figured out in a million years. That's not a drawback to the book, but an indication of my abilities at present. I figure I can come back later and retry.

[Edited] One thing to note: if you read the Kindle version in the browser app (read.amazon.com), the code blocks aren't formatted, so the indentation, etc isn't clear. On actual Kindle devices it shows up perfectly. [Thanks to Lee Vaughan himself for going above-and-beyond to check on this.]
5 reviews10 followers
January 1, 2021
Great book for helping me grasp Python on a deeper level through project-based learning.
Profile Image for Ben.
2,718 reviews218 followers
February 19, 2022
As a fairly experienced and advanced Python developer, I found this book a blast.

Got some really neat real-world examples and activities to improve my Python coding.

Would recommend for fellow Python devs!

4.8/5
Profile Image for Matt Chan.
159 reviews5 followers
April 2, 2020
I was looking for a second Python book to work through after "Python Crash Course", and I guess this suffice somewhat. I appreciated how literal the author was when he said "IMPRACTICAL" and I suppose that some of the projects were playful, but the main problem I think I had with this book is at its execution. I think there were good opportunities in the projects to be a little more instructional in programming concepts and techniques, but much of the book was really just "copy these code to do what I want you to do", and not enough discussion where I can apply coding techniques to, you know, PRACTICAL projects I might wanna do. Anyway, not a bad book by any means, but I think there were lost opportunities.
4 reviews
February 27, 2020
This book was great at enhancing my python skills especially managing large amounts of data and problems of the sort. The author lets you create multiple projects throughout the book that becomes much more advanced as you go. Eventually your new knowledge will be put to the test in the next chapters. This book gave me the ideas and knowledge to write optimized python code. The author could have put more variety between the projects since it became repetetive after a while but there was alot of varying projects that I enjoyed.
Profile Image for Mark.
AuthorÌý2 books12 followers
September 13, 2019
If you know a little Python, this collection of projects is a lot of fun. It includes applications that find anagrams, decode various ciphers, write haikus, and a simple image stacker for planetary astrophotography. Many Python modules and programming techniques are introduced.
Profile Image for Alb85.
335 reviews10 followers
August 9, 2021
Il libro ha l’ambizioso compito di programmare in Python per risolvere i problemi più disparati tra cui:
- creazione di anagrammi e codifica/decodifica di messaggi (l'autore suggerisce di approfondire leggendo ).
- progetti basati su NLP (Natural Language Processing).
- progetti basati su pygame, che riguardano sistemi particellari e simulazioni del moto dei pianeti.
Su tutto ho trovato interessante l'utilizzo della simulazione Monte Carlo (MCS), delle catene di Markov e della legge di Benford.

L’autore presenta il codice di ogni capitolo e ne descrive le parti principali. In questo modo però non vien voglia di riscrivere i progetti presentati. Di conseguenza ho semplicemente sfogliato il libro incuriosito solo dai progetti che l’autore proponeva.


Il codice dei progetti si può trovare qui: .

In sintesi: occasione sprecata.

Nozioni utili:
- PEP 8 sets standards for naming conventions. Programs such as Pylint, pycodestyle, and Flake8 can help you easily follow the PEP 8 style recommendations.
- Sets, in particular, are significantly faster than lists when using the “in� keyword.
- The Python standard library provides a handy profiling interface, cProfile, which is a C extension suitable for profiling long-running programs.
- Scaffolding, as defined here, is temporary code you write to help develop your programs, then delete when you’re done. One common piece of scaffolding is a print() statement that checks what a function or calculation returns. There’s an alternative to scaffolding. It’s called the logging module.
- Monte Carlo simulation uses repeated random sampling—in this case, each roll of the die is a random sample—to predict different outcomes under a specified range of conditions.

Spunti interessanti:
- Standardized names and procedures are especially important when you’re working in cross-functional teams. A lot can get lost in translation between scientists and engineers, as in 1999, when engineers lost the Mars Climate Orbiter because different teams used different measurement units.
Profile Image for Lee.
15 reviews2 followers
September 13, 2022
I thought this was an okay book. Lee Vaughan comes across as a brilliant scientist and I learned a lot of interesting things that did not necessarily help me improve as a programmer. The projects are pretty technical and I would have preferred he completed them in something other than IDLE. However, I did like how he provided the code so that I could at least demo the programs. All in all, I would not recommend this book to improve your Python skills unless you're specifically interested in one of the projects. Still an enjoyable read and I liked it enough to read his other book Real-World Python.
Profile Image for Ravi Sinha.
310 reviews11 followers
October 29, 2023
Thoroughly enjoyed it. What fertility in imagining projects out a wide range of scientific, mathematical, and financial realms. What thoroughness in setting up the scope and expectations of those projects. What completeness in the implementation details. Got a lot out of this one. Sat on it for a good bit - nay, worked with it for a good bit of time. Highly recommended.
Displaying 1 - 12 of 12 reviews

Can't find what you're looking for?

Get help and learn more about the design.