PyDev of the Week: Maurits van Rees

This week we welcome Maurits van Rees (@mauritsvanrees) as our PyDev of the Week. Maurits is a core developer of the Plone project as a member of the Plone Security Team and the Plone Release Team. He is also a maintainer of zest.releaser. You can find out more about what Maurits has been up to via his home page. Let’s take a few moments to get to know him better!

maurits_sm

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

I was born in the Netherlands and happily live in this European country that does not know the concept of a ‘mountain’ and that has half the population living below sea level. I am not kidding.

My first study was econometrics.  That was part mathematics (quite hard), part economics (not so interesting after a while), part informatics (the juicy part).  After a while I switched to pure informatics.  It all took me far too long, but in the end I did finish it.

I like reading fantasy and science fiction.  And writing it!  Sorry, nothing in English, but for Dutch readers there is a short story here: https://www.smashwords.com/books/view/517741

I am the younger brother of Reinout van Rees, also known in the Python community, and featured on this blog recently.  We are a lot alike: we have the same taste in music, books and programming language.  When we are at the same Python conference, we have an ongoing friendly competition on who is the first to publish a summary of a talk.

Continue reading PyDev of the Week: Maurits van Rees

Creating Graphs with Python and GooPyCharts

Over the summer, I came across an interesting plotting library called GooPyCharts which is a Python wrapper for the Google Charts API. In this article, we will spend a few minutes learning how to use this interesting package. GooPyCharts follows syntax that is similar to MATLAB and is actually meant to be an alternative to matplotlib.

To install GooPyCharts, all you need to do is use pip like this:

pip install gpcharts

Now that we have it installed, we can give it a whirl!


Our First Graph

Using GooPyCharts to create a chart or graph is extremely easy. In fact, you can create a simple graph in 3 lines of code:

>>> from gpcharts import figure
>>> my_plot = figure(title='Demo')
>>> my_plot.plot([1, 2, 10, 15, 12, 23])

If you run this code, you should see your default browser pop open with the following image displayed:

gpchart_simple

You will note that you can download the figure as a PNG or save the data that made the chart as a CSV file. GooPyCharts also integrates with the Jupyter Notebook.

Continue reading Creating Graphs with Python and GooPyCharts

PyDev of the Week: Brianna Laugher

This week we welcome Brianna Laugher as our PyDev of the Week! Brianna is the organizer behind her local PyLadies chapter in Australia. She has a very interesting website that displays her work. You might also find her Github profile illuminating. Let’s take some time getting to know our fellow Pythonista better!

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

I’m a software developer living in Melbourne, Australia. I like cycling, linguistics, free software, feminism, board games, film festivals. I’ve found I need to take care to regularly exercise otherwise spending all my time at a computer makes me sore and grumpy – the last couple of years I did triathlon, at the moment it’s yoga and pilates.

I’m quite a “joiner”, so since university I’ve been involved in several online and offline tech communities, and been lucky enough to see a good many cities around the world by way of conference attendance.

While I was at high school, the WWW started to be a thing. I taught myself basic HTML and CSS so I could make X-Files fan sites. I did a programming class in high school, but I had kind of romantic ideas about mathematics. At university I did a BA/BSc with Mandarin and mathematics, and filled in the gaps with some linguistics and computer science. (And a lot of no-credit Wikipedia editing.) Over 5 years I slowly realised the programming was a better idea than the maths. When I was finished I wasn’t sure what to do, so I started an Honours year, but at the end of first semester I panic-procrastinated and failed a subject and left.

I was extremely lucky to hear about a job from a friend, for a small company doing R&D in rules-based machine translation. (This is probably a quaint idea now.) I worked for a couple of years using Prolog to encode the grammar of the language Tagalog. After that I worked at the Bureau of Meteorology on natural language generation. I used Python to automatically convert weather-related statistics to brief English descriptions.

That project ended in 2014. I had been learning Spanish for a few years and I was keen to put it into practice, so I took part in a program called ‘Auxiliares de Conversación’, where native English speakers can work as assistants to English teachers in schools in Spain, for a stipend. It was an amazing experience and I loved the ability to ‘hop over’ to Brussels in a mere two hour flight! I was there for 10 months.

Now I am working at Planet Innovation, a consultancy focused on product development and commercialization. I’m using Python to work on web software that talks to medical devices.

Continue reading PyDev of the Week: Brianna Laugher

Python 201: Intermediate Python FREE until Wednesday!

I decided it would be fun to give my latest book away for free until this Wednesday, Oct 19th. So starting today, you can get Python 201: Intermediate Python free through Gumroad or Leanpub.

If you go with Gumroad, then you will need to use the following offer code: 201free. Note that if you want to receive updates to the book, you will want to create an account and add the book to your library.

Python201_cover20160330_sm-237x300

PyDev of the Week: Glyph Lefkowitz

This week we welcome Glyph Lefkowitz (@glyph) as our PyDev of the Week! Glyph is the creator / maintainer of Twisted, an asynchronous event-driven networking engine. Glyph finds the time to write a blog that you might find quite interesting. You can also check out Github to see what projects he’s involved with. Let’s spend a few minutes getting to know Glyph better!

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

I’m just this guy, you know?

I work on a lot of open source software, both for work – I maintain Twisted, and a ton of associated ecosystem projects, for Rackspace – and personally.

My hobbies mainly revolve around computers. For example, I’m an avid video game fan. I’ve also dabbled in graphic design, 3D rendering, and computer-generated music; although nothing really good enough to share. As time allows, I’m also a really big reader, particularly of science fiction and fantasy.

In summary, I’m a nerd in the classic sense. To complete the caricature, my wife is also a programmer and so my personal life revolves around computer technology as well. We both also have a strong interest in information security, so I spend a fair amount of time ensuring that our systems are up to date, our passwords are rotated, and so on.

Continue reading PyDev of the Week: Glyph Lefkowitz

How to Create a Diff of an Image in Python

For the past couple of years, I’ve been writing automated tests for my employer. One of the many types of tests that I do is comparing how an application draws. Does it draw the same way every single time? If not, then we have a serious problem. An easy way to check that it draws the same each time is to take a screenshot and then compare it to future versions of the same drawing when the application gets updated.

The Pillow library provides a handy tool for this sort of thing that is called ImageChops. If you don’t already have Pillow, you should go install it now so you can follow along with this short tutorial.


Comparing Two Images

The first thing we need to do is find two images that are slightly different. You can create your own by using burst mode on your camera and taking a bunch of photos of animals as they move, preferably while using a tripod. Or you can take an existing photo and just add some kind of overlay, such as text. I’m going to go with the latter method. Here is my original photo of Multnomah Falls in Oregon:

multnomah_falls

Continue reading How to Create a Diff of an Image in Python

PyDev of the Week: Paul Logston

This week we welcome Paul Logston (@PaulLogston) as our PyDev of the Week! Paul is the new maintainer for Pyvideo.org. He took over for Will Kahn-Greene. You can read more about the transition here. He is also an organizer for his local Python Users Group. You might want to take a few moments to check out his Github profile so you can see what Paul has been up to. Let’s take some time to get to know him better!

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

Went to UC Davis for Chemical Engineering, studied improv in Chicago after college, studied as an EMT/Phlebotomist to work as one while doing comedy. Moved to New York, NY to continue doing comedy. Taught CPR/BLS/ACLS for a few years while doing comedy. Then decided to change careers. Decided to push for coding as I had done it all along as a hobby. After about a year of teaching myself Python, I moved from EMS education to working for 15Five as a developer. The NYC Python Meetup was integral in my Python education. Without that group, I wouldn’t be were I am today. I now help organize that group and run Saturday Office Hours along with some large talk nights and PyGotham; NYC’s regional Python conference. Other hobbies include binge watching Netflix originals, brewing kombucha, and teaching.

Continue reading PyDev of the Week: Paul Logston

An Intro to the Python Imaging Library / Pillow

The Python Imaging Library or PIL allowed you to do image processing in Python. The original author, Fredrik Lundh, wrote one of my favorite Python blogs when I first started learning Python. However PIL’s last release was way back in 2009 and the blog also stopped getting updated. Fortunately, there were some other Python folks that came along and forked PIL and called their project Pillow. The Pillow project is a drop-in replacement for PIL that also supports Python 3, something PIL never got around to doing.

Please note that you cannot have both PIL and Pillow installed at the same time. There are some warnings in their documentation that list some differences between PIL and Pillow that get updated from time to time, so I’m just going to direct you there instead of repeating them here since they will likely become out of date.


Install Pillow

You can install Pillow using pip or easy_install. Here’s an example using pip:

pip install Pillow

Note that if you are on Linux or Mac, you may need to run the command with sudo.


Opening Images

jelly

Pillow makes it easy to open an image file and display it. Let’s take a look:

from PIL import Image
 
image = Image.open('/path/to/photos/jelly.jpg')
image.show()

Here we just import the Image module and ask it to open our file. If you go and read the source, you will see that on Unix, the open method saves the images to a temporary PPM file and opens it with the xv utility. On my Linux machine, it opened it with ImageMagick, for example. On Windows, it will save the image as a temporary BMP and open it in something like Paint.

Continue reading An Intro to the Python Imaging Library / Pillow

Python 101/201 Educational Giveaway

I think it’s very important for teens and college students to learn how to program. Science, Technology, Engineering and Mathematics is such a crucial set of topics to learn about that I have decided to give away copies of Python 101 and Python 201: Intermediate Python to teachers and professors starting today until 11:59 p.m. CST of October 14th, 2016.

Students with valid educational email addresses can also enter to get a free copy of the eBooks, but they will not be eligible for the paperbacks.

How to Get a Copy

Just leave a comment or contact me via my contact form and tell me why you want a copy. I do require some kind of proof that you’re an educator. If you can leave a comment or send me an email via the contact form using an official email address (such as an *.edu domain) or link me to some other proof (LinkedIn, your profile on a school website, etc), that would be great.

Prizes

  • Everyone who enters with a valid educational email or other type of proof will receive am eBook copy of Python 101 and Python 201.
  • 5 lucky winners will get a copy of the paperback version of Python 201: Intermediate Python + the above
  • The Grand Prize will be a paperback copy of Python 101 and Python 201: Intermediate Python + the eBook copies

Deadline

Get your comment or send in an email via the contact form before October 14th, 2016 at 11:59 p.m. CST and you will be entered. I’ll go through the entries and contact the winners.

PyDev of the Week: Bryan Van de Ven

This week we welcome Bryan Van de Ven (@bigreddot) as our PyDev of the Week! Bryan is a core developer of the Bokeh project, which is a visualization package for Python. He has also helped with the development of Anaconda. You can check out what projects he is a part of on Github. Let’s take a few moments to learn some more about our fellow Pythonista!

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

I currently work for Continuum Analytics in Austin, TX. I’ve been around there since day one, and helped with the development of Anaconda and the conda package manager early on. I’m very interested in the question of finding sustainable ways for companies to truly help and support open source and open source communities.

My educational path was a bit meandering. I studied Computer Science, then Physics and Mathematics at the University of Texas. I was lucky enough to have the opportunity to take classes from Dijkstra and Weinberg while I was there. Later, I went to grad school for Physics at UCLA, but (fortunately!) left the PhD program early. Fun fact: UC system diplomas have the Governor’s signature, so at the end of all that at least I got an Arnold Schwarzenegger autograph!

For relaxing, I cook, work out, travel when I can, and practice Portuguese. I also love going to “Master Pancake Theater” movie-mocking shows at the Alamo Drafthouse. Anyone who visits Austin should try to check them out: https://drafthouse.com/series/master-pancake

Continue reading PyDev of the Week: Bryan Van de Ven