How to Self-publish a Programming Book

What I learned from writing three Python books in a year

Image for post
Image for post
Photo by Eugenio Mazzone on Unsplash
  • Writing the manuscript.
  • Making it available for sale.
  • Generating sales.

Why self-publish an e-book?

In my case, I have been writing technical posts on various websites for quite a few years (I created my first website in 1995), mainly as a way of learning new topics for my own benefit. I have thought about writing a book from time to time, but I never got around to it for a couple of reasons. I wasn’t convinced that anyone really wanted books any more, and I didn’t want to invest a huge amount of effort in proving it.

Choosing and researching the topic

Writing a is probably going to take a lot of your spare time for weeks or months, so it is a good idea to choose a topic that you are interested in. It helps if you know something about the topic too, although it doesn’t have to be a subject you know inside out, just so long as you know enough to be able to research it in a reasonable time frame.

Writing the manuscript

The most time consuming part of writing a book, of course, is the mental process of expressing yourself in words. In some ways, the method you use to record those words is secondary. Almost any text editor, word processor, or pen and paper, will allow you to so it, and no fancy application is going to write the words for you.

  • It is easy to re-purpose blog posts as book content — my websites use markdown too.
  • It handles code highlighting very well.
  • Leanpub (my preferred publisher) supports it as their primary input.

Making your book available for sale

There are quite a few options here. The most straightforward way to make your book available for sale is to put it on some digital download site (Gumroad for example). Set up an account, add your book, and start selling. The free tier is good enough to start with, so all it costs you is a small percentage of each sale.

Generating sales

Whatever option you take, you will probably find that most of your sales are self-generated. I sell a few copies a month to people who have stumbled across my books on Amazon, but the majority are from people who have found one of my books via my website or social media, and gone on to buy it from Leanpub.

Written by

I am a software developer with over 30 years experience in Java, Python and C++. I write for

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store