Python for Designers

by Roberto Arista

Fork me on GitHub

Why This Manual

While I was writ­ing this man­ual, I of­ten asked my­self whether it would be use­ful. Es­pe­cially af­ter brows­ing the avail­able lit­er­a­ture on cre­ative cod­ing. There is a lot out there! Do we need an­other re­source? John Maeda wrote Design By Numbers, a land­mark text for de­sign­ers in­ter­ested in pro­gram­ming, back in 1999. I would as­sume that 18 years are enough to rec­on­cile graphic de­sign­ers with com­puter pro­gram­ming. And yet, when I look around, I still see that many de­sign­ers re­ject the idea of writ­ing code al­to­gether. While some be­lieve that pro­gram­ming is not their “con­cern,” some oth­ers are forced by the com­pe­ti­tion to cob­ble to­gether a bit of Javascript with­out a proper in­tro­duc­tion. In the first case, there is some sim­plis­tic con­tra­po­si­tion be­tween hu­man­is­tic and sci­en­tific/​tech­ni­cal sub­ject: “I like to draw there­fore I do not want to deal with any tech­ni­cal­ity.” In the sec­ond case, the ap­proach is way more prag­matic, but it could turn out in a night­mare. To cus­tomize and main­tain some­thing with­out ex­ten­sive knowl­edge can be stress­ful. De­sign schools are of­ten part of the prob­lem, be­cause cod­ing ap­pears too late into their cur­ric­ula. It is not just a mat­ter of teach­ing “how to prop­erly in­struct a ma­chine,” but to in­vite stu­dents to solve de­sign tasks ex­ceed­ing the stan­dard Pho­to­shop/​Il­lus­tra­tor/​In­De­sign trip­tych: the best way to learn how to pro­gram is to pro­gram for a pur­pose. Luck­ily, in the last few years the sit­u­a­tion im­proved also thanks to the wide­spread adop­tion of Pro­cess­ing and Javascript, but graphic de­sign­ers have a long way to go be­fore be­com­ing gen­er­ally com­fort­able with au­tomat­ing sim­ple tasks.

Of course, man­u­als need to fol­low the de­vel­op­ment of new tools. The de­vel­op­ment en­vi­ron­ment pre­sented in Design By Numbers is not main­tained any­more, and tech­nol­ogy has evolved quite a lot in these 18 years. There are no Python pro­gram­ming man­u­als writ­ten with a de­signer in mind. Fur­ther­more, my fa­vorite Python graph­ics mod­ule/​ap­pli­ca­tion – Draw­Bot – comes with de­tailed API doc­u­men­ta­tion but with­out an ex­ten­sive in­tro­duc­tory man­ual. This is why I thought it would be nice to merge that gap for my stu­dents and then share the re­sult with the outer world.

Pro­gram­ming re­sources con­ceived for de­sign­ers are mainly de­voted to Pro­cess­ing or Javascript and its frame­works. Dur­ing my stud­ies, I dis­cov­ered Python. It is the stan­dard script­ing lan­guage in font edit­ing ap­pli­ca­tions. And I am very pas­sion­ate about it. I am con­vinced that is by far one of the best choices for a de­signer. Why? Here are some rea­sons:

  • In Python, white space is semantic. The language interpreter requires a typographical structure helps writers and readers to organize blocks of code neatly.
  • General purpose. Python was not designed for a specific application; instead it is a general-purpose language which can give you access to many different places: data analysis, Web and desktop applications, scientific and numeric computing, computer vision, images manipulation and so on.
  • It has been around since the 90’s; therefore the amount of documentation and help available online is vast and well organized.
  • It could be defined as a terminal language on steroids. This manual focuses on your machine. What can you achieve with your computer that cannot be done through a user interface? Believe me, a lot.
  • Computer scientists were not the primary main users of Python’s development team. A democratic, yet beautiful, programming language. It allows anyone to write from simple to complex programs without a deep understanding of memory and hardware (differently from languages as C++).

Python can help you de­sign and make books, il­lus­tra­tions, data vi­su­al­iza­tions, maps, an­i­ma­tions, han­dle web­sites, pro­to­type desk­top or web apps, sort stuff, crunch num­bers, dive into your hard drive, down­load data and more. What do you want to do with it?

Dis­claimer: if you de­sire to learn the ba­sic of web de­sign and de­vel­op­ment, this is not the right man­ual for you. If that is the case, I ad­vise an in­tro­duc­tory man­ual to HTML and CSS. Then if you want to be able to ma­nip­u­late HTML and CSS with some script­ing, I be­lieve you will need Javascript.