This review has been a long time coming because I wanted to make sure I read this book thoroughly before making up my mind.
After a short introduction, there is a short chapter on getting the Pi up and running. I’m happy to say that this is very short, as is appropriate for a book which is not aimed at beginners to the Pi. Next up is a “A Really Quick Introduction to Python” which users Turtle graphics to introduce you to the language and it’s syntax and takes you through building a very simple game.
The next chapter, “Python Basics” takes you through data types, conditions and loops before taking you onto re-using your code in functions, objects and modules. It may be somewhat of a whistle-stop tour of these concepts, but it’s expertly and concisely done. It’s in this chapter that you really start to get a feel for the book and it’s style and it is a very comfortable, clear style.
The next chapter introduces Qt and helps you to build a user interface for your Turtle program. Then, it takes you onto building your very own web browser using Qt. The next chapter introduces Pygame and helps you to create a game, from prototyping the functions you’ll need to ‘filling in the gaps’ and creating a rudimentary platform game.
Chapter 6 is titled “Creating Graphics with OpenGL” and introduces you to the more complicated world of 3D graphics. Then, the next chapter instructs you on creating a networked chat application using sockets before moving onto creating dynamic websites and sending messages via Twitter.
Chapter 8 is the inevitable section on Minecraft and takes you through building a ‘snake’ game. I felt that this chapter could have been expanded more, but on the other hand there are plenty of tutorials out there on the web for Minecraft. A slight missed opportunity.
Chapter 9 is all about multimedia and covers PyAudio for sound and using both USB webcams and the PiCamera module. Chapter 10 is all about Scripting and shows you how to use Python and the Linux command line as a workhorse for taking care of various tasks.
Chapter 11 is great as it introduces the RPi.GPIO library and manipulating the Pi’s GPIO pins for both input (switches and sensors, including analog) and output (LEDs). I feel that this chapter could have been longer and gone into as much depth as the software side. Given that the Pi’s unique selling point is the GPIO, more ground could have been covered. Some ideas for what to do next are given, but going into one of these and producing a full example (like they did in previous software chapters) would have been a valuable addition to the book.
The final chapter is all about testing and debugging. This is very complicated and definitely not for the beginner. It does give hints on doing minor debugging but a lot of emphasis is on regression and unit testing – pretty heady stuff! A comprehensive index rounds off the book.
Learning Python with Raspberry Pi is a great read if you want to get into programming with this particular language. By minimising section on the ‘basics’ of getting the Pi up and running, Bradbury & Everard have left themselves with plenty of space in the book to delve into other aspects, such as multimedia and hardware. The opening chapters in particular, in which the basics of Python are introduced and explored are outstanding and the worked examples are thorough and clear. I haven’t typed in every single example, but the code that is in the book appears to be well written and structured. The writing style is very slick and cohesive throughout the book and the explanations given are well thought-through.
In summary, I’d fully recommend the book to anyone wanting to get into Python. Ideally you should have some experience with programming (even if it’s in something simple like Scratch) so you can understand the syntax explanations, but it’s not essential. This is great for beginners to the language and for those seeking to go deeper into some of the available libraries. Congratulations should go out to the authors on the creation of a great resource.