Drawing Text on Images With Pillow and Python

Pillow supports drawing text on your images in addition to shapes. Pillow uses its own font file format to store bitmap fonts, limited to 256 characters. Pillow also supports TrueType and OpenType fonts as well as other font formats supported by the FreeType library.

In this chapter, you will learn about the following:

Getting GPS EXIF Data With Python

Did you know that you can get EXIF data from JPG image files using the Python programming language? You can use Pillow, the Python Imaging Library's friendly fork to do so. You can read an article about that on this website if you want to.

Here is some example code for getting regular EXIF data from a JPG file:

Python 101 – Creating Multiple Processes

Most CPU manufacturers are creating multi-core CPUs now. Even cell phones come with multiple cores! Python threads can’t use those cores because of the Global Interpreter Lock. Starting in Python 2.6, the multiprocessing module was added which lets you take full advantage of all the cores on your machine.

In this article, you will learn about the following topics:

PyDev of the Week: Elana Hashman: The Mouse Vs. The Python

Check out this week's PyDev of the Week!

This week, we welcome Elana Hashman (@ehashdn) as our PyDev of the Week! Elana is a director of the Open Source Initiative and a fellow of the Python Software Foundation. She is also the Clojure Packaging Team Lead and a Java Packaging Team member. You can see some of her work over on GitHub. You can also learn more about Elana on her website. Let's take a few moments to get to know her better!

You may also like: [DZone Refcard] Core Python
Can you tell us a little about yourself (hobbies, education, etc):

I love to bake and cook, so my Twitter feed tends to be full of various bread pictures or whatever dish I've whipped up over the weekend. When I was a kid, I was completely hooked on the cooking channel — my favorite shows were "Iron Chef" and "Good Eats" — and I thought I'd become a chef when I grew up. That's my back up plan if I ever drop out of tech!

PyDev of the Week: Veronica Hanus: The Mouse Vs. The Python

Check out this week's PyDev of the Week

This week, we welcome Veronica Hanus (@veronica_hanus) as our PyDev of the Week! Veronica is a regular tech speaker at Python and other tech conferences and meetups. You can see some of her talks and her schedule on her website. She has been active in the Python community for the past few years. Let's take a few moments to get to know her better!

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

An Intro to StaticBox and StaticBoxSizers

There are many widgets that are included with the wxPython GUI toolkit. One of them is a fairly handy widget called wx.StaticBox. This widget accepts a string and then will draw a box with the string in the upper left-hand corner of the box. However, this only works when you use it in conjunction with wx.StaticBoxSizer.

Here is an example of what one might look like:

Tutorial on wxPython 4 and PubSub

The Publish-Subscribe pattern is pretty common in computer science and very useful too. The wxPython GUI toolkit has had an implementation of it for a very long time in wx.lib.pubsub. This implementation is based on the PyPubSub package. While you could always download PyPubSub and use it directly instead, it was nice to be able to just run wxPython without an additional dependency.

However, as of wxPython 4.0.4, wx.lib.pubsub is now deprecated and will be removed in a future version of wxPython. So now you will need to download PyPubSub or PyDispatcher if you want to use the Publish-Subscribe pattern easily in wxPython.

Pros and Cons of Indie Tech Publishing

I personally really love self-publishing, or indie publishing, so I am a little biased. In this article, I will go over what I think are the pros and cons of indie publishing versus going with a "real" publisher.

Pros

Here are my favorite parts about indie publishing:

Creating a Calculator With wxPython

A lot of beginner tutorials start with “Hello World” examples. There are plenty of websites that use a calculator application as a kind of “Hello World” for GUI beginners. Calculators are a good way to learn because they have a set of widgets that you need to lay out in an orderly fashion. They also require a certain amount of logic to make them work correctly. For this calculator, let’s focus on being able to do the following:

  • Addition
  • Subtraction
  • Multiplication
  • Division

I think that supporting these four functions is a great starting place and also give you plenty of room for enhancing the application on your own.

PyDev of the Week: Lorena Mesa

This week we welcome Lorena Mesa (@loooorenanicole) as our PyDev of the Week! Lorena is an organizer for the PyLadies Chicago group and a director at the Python Software Foundation. You can check out some of the things that she is up to on her blog or via her Github page. Let’s spend a few moments getting to know her better!

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

Hmmm…I have been told that I’m a bit eclectic. So let’s start with the basics. In my day-to-day gig I am a proud member of GitHub’s software intelligence systems team as a data engineer. In my extra hours I do such things as co-organize PyLadies Chicago and serve as a Director for the Python Software Foundation.

Creating and Manipulating PDFs with pdfrw

Patrick Maupin created a package he called pdfrw and released it back in 2012. The pdfrw package is a pure-Python library that you can use to read and write PDF files. At the time of writing, pdfrw was at version 0.4. With that version, it supports subsetting, merging, rotating and modifying data in PDFs. The pdfrw package has been used by the rst2pdf package (see chapter 18) since 2010 because pdfrw can “faithfully reproduce vector formats without rasterization.” You can also use pdfrw in conjunction with ReportLab to re-use potions of existing PDFs in new PDFs that you create with ReportLab.

In this article, we will learn how to do the following: