Category Archives: Books

Books that I’ve read, reviewed or cited for this article

Type Checking in Python

Type checking or hinting is a newer feature of Python that was added in Python 3.5. Type hinting is also known as type annotation. Type hinting is adding special syntax to functions and variable declarations that tell the developer what type the argument or variable is.

Python does not enforce the type hints. You can still change types at will in Python because of this. However some integrated development environments, such as PyCharm, support type hinting and will highlight typing errors. You can also use a tool called Mypy to check your typing for you. You will learn more about that tool later on in this article.

You will be learning about the following:

  • Pros and Cons of Type Hinting
  • Built-in Type Hinting / Variable Annotation
  • Collection Type Hinting
  • Hinting Values That Could be None
  • Type Hinting Functions
  • What To Do When Things Get Complicated
  • Classes
  • Decorators
  • Aliasing
  • Other Type Hints
  • Type Comments
  • Static Type Checking

Let’s get started! Continue reading Type Checking in Python

Stuck at Home Python Book Sale

Python is one of the most popular languages in the world. I have been using it myself for over a decade and am still constantly learning new things.

Since so many people are stuck at home, I thought it might be a good time to do a book sale. Now is great time to learn Python or learn a new skill using Python.

With that in mind, I have all my books for sale. Just use the special links below to get the sale price:

There are free chapters available at each of the links. You can download the sample by clicking on the Read Free Sample button on the left.

Feel free to ask me any questions you might have about the books.

What’s New in Python 101 2nd Edition

The original Python 101 was the first book I had ever written. In deciding to write a 2nd edition, I needed to decide what I should keep and what I should remove from the book. What I ended up doing was rewriting the book from the ground up.

Python 101 2nd Ed Kickstarter

In the original book, Python 101 was based on Python 3.5 and had the following sections:

  • Part I – Learning the basics
  • Part II – Learning from the library
  • Part III – Intermediate Odds and Ends
  • Part IV – Tips, tricks and tutorials
  • Part V – Packaging and Distribution

For the 2nd edition, I am dropping part II as most of that information can be covered in later chapters. Now that Python 3.8 is out, I am able to cover such things as

  • f-strings
  • assignment expressions
  • dictionaries being ordered by default
  • type hinting
  • source control
  • review questions for most chapters
  • and more!

And mention other neat things, like sub-interpreters, the futures module, and audit hooks, although those won’t be covered in detail. I am also planning on making the tutorials section into a more proof-of-concept section where you will have little useful scripts that you can take and use. That was already there to some degree, but I think these scripts will be even better than the original ones.

The distribution section will also get a makeover to cover the latest conventions for distributing your code to the Python Packaging Index. The original book’s coverage is out of date.

Also while the first book mentioned lots of different options for creating executables, the new version of the book will focus on only one or two, but it will show how to create a binary for Windows and Mac. I am investigating how to support Linux, but that may or may not be included.

I will be making quite a few chapters available in the free sample available on Leanpub so people can check it out before purchasing.

I hope you’ll check out the book. Feel free to ask questions in the comments or send me an email.

Python 101 2nd Edition will be released in September 2020

Python 101 2nd Edition Kickstarter Ending in Two Days

My Kickstarter for the 2nd Edition of Python 101 is ending in less than two days. If you want a signed copy or to purchase one of my other books for a discount, you should check out the Kickstarter as I have lots of good deals on there.

Python 101 2nd Ed Kickstarter

Also, note that the 2nd Edition of Python 101 is a complete rewrite. This book will have all new content and is on track to be one of my longest books. I think you will really like it if you are a beginner learning Python or someone who has been using Python but would like to improve to the next level.

Python 101 2nd Edition Fully Funded + Stretch Goals

The second edition of my book, Python 101, has been successfully funded on Kickstarter. As is tradition, I have added a couple of stretch goals for adding more content to this already hefty book.

Python 101 2nd Ed Kickstarter

Here are the goals:

1) $5000 – Get 4 Bonus Chapters

These chapters would cover the following topics:

  • Assignment Expressions
  • How to Create a GUI
  • How to Create Graphs
  • How to Work with Images in Python

2) $7500 – Add Chapter Review Questions

The additional chapters are pretty exciting to me as they are fun things to do with Python while also being useful. The assignment expression chapter is also something that is new in Python and may be of use to you soon.

Adding chapter review questions was something I have always wanted to do with Python 101. Hopefully you will find that idea interesting as well.

If you are interested in getting the book or supporting this site, you can head over to Kickstarter now. There are some really good deals for some of my other books there too!

Python 101 2nd Edition Kickstarter is Live!

I am excited to announce that my newest book, Python 101, 2nd Edition is launching on Kickstarter today!

Python 101 2nd Ed Kickstarter
Click the Photo to Jump to Kickstarter

Python 101 holds a special place in my heart as it was the very first book I ever wrote. Frankly, I don’t think I would have even written a book if it weren’t for the readers of this blog who encouraged me to do so.

The new edition of Python 101 will be an entirely new, rewritten from scratch, book. While I will be covering most of the same things as in the original, I have reorganized the book a lot and I am adding all new content. I have also removed old content that is no longer relevant.

I hope you will join me by backing the book and giving me feedback as I write it so that I can put together a really great learning resource for you!

Black Friday Deals on Python Books

Interesting in learning Python? Well you will be happy to know that I am running a Black Friday / Cyber Monday sale of my Python books. But I am starting the sale early so that you have plenty of time to decide if you’d like to buy one of my books. Check them out below!

All My Python Books

Note that Python 101 is free. You can bump the amount to pay all the way down to $0 if you’d like a free copy.

Also note that all my books have free sample chapters so you can check those out before you purchase.


Creating GUI Applications with wxPython

Creating GUI Applications with wxPython is my latest book. In it you will learn how to create cross-platform desktop applications using wxPython. Use this link or click the image above to get a discount.


Jupyter Notebook 101

The Jupyter Notebook is a great teaching tool and it’s a fun way to use and learn Python and data science. I wrote a nice introductory book on the topic called Jupyter Notebook 101.


ReportLab – PDF Processing with Python

Creating and manipulating PDFs with Python is fun! In ReportLab – PDF Processing with Python you will learn how to create PDFs using the ReportLab package. You will also learn how to manipulate pre-existing PDFs using PyPDF2 and pdfrw as well as a few other handy PDF-related Python packages.


Python 201: Intermediate Python

Python 201: Intermediate Python

Python 201: Intermediate Python is a sequel to my first book, Python 101 and teaches its readers intermediate to advanced topics in Python.

PyDev of the Week: Peter Farrell

This week we welcome Peter Farrell (@hackingmath) as our PyDev of the Week! Peter is the author Math Adventures with Python and two other math related Python books. You can learn more about Peter by visiting his website.

Let’s take a few moments to get to know Peter!

Can you tell us a little about yourself (hobbies, education, etc):

I was brought up in the US, earned a B.A. in Math and taught Math for 8 years in big and small schools. I always wanted to show students the real-world applications of the stuff they were learning, all of which turned out to be computer-related. I learned to program in my 30’s in Logo by going page-by-page through Samuel Papert’s brilliant book Mindstorms. After that I taught all my math classes turtle programming. A student turned me on to Python and I never looked back. Away from the computer, I like to play guitar and watch documentaries. Continue reading PyDev of the Week: Peter Farrell

wxPython – Creating a PDF Merger / Splitter Utility

The Portable Document Format (PDF) is a well-known format popularized by Adobe. It purports to create a document that should render the same across platforms.

Python has several libraries that you can use to work with PDFs:

  • ReportLab – Creating PDFs
  • PyPDF2 – Manipulating preexisting PDFs
  • pdfrw – Also for manipulating preexisting PDFs, but also works with ReportLab
  • PDFMiner – Extracts text from PDFs

There are several more Python PDF-related packages, but those four are probably the most well known. One common task of working with PDFs is the need for merging or concatenating multiple PDFs into one PDF. Another common task is taking a PDF and splitting out one or more of its pages into a new PDF.

You will be creating a graphical user interface that does both of these tasks using PyPDF2. Continue reading wxPython – Creating a PDF Merger / Splitter Utility