What I learned from writing three Python books in a year

Image for post
Image for post
Photo by Eugenio Mazzone on Unsplash

Over the past year or so, I have written three e-books on various topics in Python programming. Although I certainly don’t consider myself to be an expert on self-publishing, I have learned a bit in this time, so I will share it here. I hope you might find it useful.

This article covers four stages:

  • Choosing and researching the topic.
  • Writing the manuscript.
  • Making it available for sale.
  • Generating sales.

I have found the whole process takes me about 3 months, if I put most of my hobby time into it. …

Process images in 3 lines of Python

Image for post
Image for post

Pillow is a versatile and popular Python imaging library. The ImageEnhance module is a particularly useful module within Pillow. It can be used to adjust colour, contrast, brightness and sharpness in a few simple lines of code.

_Enhance interface

Each image enhance function is implemented as an object that implements the _Enhance interface. The interface provides a single method:


For example, the ImageEnhance.Brightness class controls the brightness of an image, It has an enhance method that it inherits from _Enhance.

factor is a number that controls the effect. For example, for Brightness a factor of less than 1.0 makes the image darker (and a value of 0.0 makes the image completely black). A factor of greater than 1.0 makes the image brighter. …

Easy animation with generativepy

Image for post
Image for post
Photo by Gensa Hub on Unsplash

generativepy makes it very easy to create animated GIFs. This can be done with a simple script, and usually results in a fairly well optimised GIf file.

The gif module makes use of the gifsicle application. This can be downloaded for free, and must be installed on your system in order for the gif module to work.

GIF images

GIF (Graphics Interchange Format) is a bitmap image format that was developed in the 1980s for transferring images over networks. …


Martin McBride

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

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