Yet another book on Python programming, I read it back in 2014 and must say – I was really impressed, as it’s provided a whole set of skills that I could immediately apply. In this sense, the Pragmatic Programmers series served me well once again – this guide to Python is very practical. Seems there's a more recent version of it so I'll be reading it and updating this page soon!
Getting started with Python
The layout of the book ensures that you are getting foundation topics first.
First, you are shown the very basics of Python: simple math and operating with variables. There is a whole chapter devoted to working with strings, their importance in any programming language is universally high.
Once you are more comfortable, you are introduced to modular approach for coding software with Python: importing functionality from standard modules and defining your own modules.
Thanks to the strict syntax requirements, writing a Python code is a thing of beauty. Functions and loops are self-explanatory in most cases, and writing code encourages you to organise logic into functions and to automatically document interfaces.
Before moving on to lists and flow controls, there’s a little bit about working with objects and methods. There’s even an introduction to testing and coding style – it’s very helpful to sort these things out while you’re still very new to Python.
Lists are an amazingly flexible feature in Python, and chapter on Lists is one of the most useful in the whole book. The true beauty of lists is that they are universal – for instance, you can open a file and then access its content as a Python list with the same common methods.
About halfway into the book, you are given enough info and shown enough examples to write quite complex yet elegant pieces of software.
More useful Python skills
Second half of the book covers more advanced topics and goes into greater level of details.
I especially appreciated the chapters on file processing (lots of good examples) and sets/dictionaries. Both chapters were very useful for the recent automation script I wrote – parsing a mix structure configuration file to produce stats based on certain fields.
The databases chapter, in my view, could have been longer and more detailed, but it still provided a very good introduction and showed all the necessary elements for you to effortlessly integrate your Python software with a database.
If you’re interested in object-oriented programming with Python, this book will give you a concise but relevant introduction. If you decide to learn how to add a graphical user interface to your Python software, there’s a chapter on that too. You are also given a great introduction to algorithms and basic approaches to searching and sorting routines.
In summary, I would say this book is an excellent way to learn basics and get started with Python. Each chapter contains lots of questions and exercises for you to answer and solve. All the concepts are provided with complete and easy to understand examples.
This book should be enough of a guidance to write your very first relatively complex software projects with Python. Will also be a great book if at any stage you feel like refreshing your Python skills.
By this book on Amazon: Practical Programming – Introduction to Python.