Preface

Processing.py is an interactive programming and graphics framework for the Python programming language. Jonathan Feinberg created Processing.py in 2010, basing his work on an existing programming framework called Processing, created by Casey Reas and Ben Fry in 2001. Casey and Ben were inspired by how simple it was to write interesting programs with the languages of their childhood (Logo and BASIC), and intended their framework to be a way to sketch (prototype) full-screen, interactive software without the frustration of languages typically used for this purpose at the time (C++ and Java).

When the Processing project was first created, it was intended to be a language-agnostic, arts-oriented approach to interactive programming, taking inspiration from OpenGL, PostScript, and Design By Numbers, among other sources. Although early versions of Processing were compatible with the Python programming language, a decision was made to focus the team’s limited resources on a Java-based syntax. Jonathan Feinberg’s Processing.py project restored Python compatibility to the project. (For more information on the relationship between Processing, Processing.py, and Python, see Appendix E.)

Processing was designed to be an ideal environment for teaching design and art students how to program and to give more technical students an easier way to work with graphics. The combination is a positive departure from the way programming is usually taught and, since 2001, Processing has been at the center of a growing movement to promote software literacy in the visual arts and visual literacy within technology.

I’m a strong believer in the power of the Python programming language and have taught Python with great success to novice programmers in many disciplines, from software engineering to the humanities to the arts. For this reason, I was overjoyed when Casey and Ben approached me to help write this book, which brings together their time-tested creative coding framework with a programming language I’ve found so friendly and productive for novice coders and experts alike. We believe that Processing.py is not just a great framework for learning how to program but an invaluable addition to the toolbox of Python programmers of all stripes who need a simple and clear means of making interactive applications.

This book is available in three slightly different versions. One version is an introduction to Processing using its traditional, Java-based syntax, and a second covers p5.js, a version of Processing reinterpreted for today’s Web. The version you now have in your possession introduces Processing with the Python programming language, using Processing.py as the bridge between the two. The three books are organized in very similar ways, and much of the content is identical from one book to the other. The main difference, of course, is that the code examples in this book are all written in Python. This book also contains some additional information and educational material about Python-specific techniques, idioms, and data structures. We believe this book will work well as an introductory text for the Processing Development Environment, the Python programming language, and interactive programming in general.

We hope you’ll have fun with this book and be inspired to continue programming. Let’s begin!

How This Book Is Organized

The chapters in this book are organized as follows:

Who This Book Is For

This book is written for people who want a casual and concise introduction to computer programming so that they can create images and simple interactive programs. It’s especially suited to beginning programmers who want to learn the Python programming language. Getting Started with Processing.py is not a programming textbook; as the title suggests, it will get you started. It’s for teenagers, hobbyists, grandparents, and everyone in between.

This book is also appropriate for people with programming experience, particularly in the Python programming language, who want to learn the basics of interactive computer graphics. Getting Started with Processing.py contains techniques that can be applied to creating games, animation, and interfaces.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Note

This type of paragraph signifies a general note.

Warning

This element indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from Make: books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Make: Getting Started with Processing.py by Allison Parrish, Ben Fry, and Casey Reas. Copyright 2016 Maker Media, Inc., 978-1-457-18683-7.”

If you feel your use of code examples falls outside fair use or the permission given here, feel free to contact us at [email protected].

Safari® Books Online

Safari Books Online is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of plans and pricing for enterprise, government, education, and individuals.

Members have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like Maker Media, O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and hundreds more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

  • Maker Media, Inc.
  • 1160 Battery Street East, Suite 125
  • San Francisco, California 94111
  • 800-998-9938 (in the United States or Canada)
  • http://makermedia.com/contact-us/

Make: unites, inspires, informs, and entertains a growing community of resourceful people who undertake amazing projects in their backyards, basements, and garages. Make: celebrates your right to tweak, hack, and bend any technology to your will. The Make: audience continues to be a growing culture and community that believes in bettering ourselves, our environment, our educational system—our entire world. This is much more than an audience, it’s a worldwide movement that Make: is leading—we call it the Maker Movement.

For more information about Make:, visit us online:

Acknowledgments

We thank Brian Jepson, Anna Kaziunas France, and Patrick DiJusto for their great energy, support, and insight.

We can’t imagine this book without Massimo Banzi’s Getting Started with Arduino (Maker Media). Massimo’s excellent book is the prototype.

A small group of individuals has, for years, contributed essential time and energy to Processing. Dan Shiffman is our partner in the Processing Foundation, the 501(c)(3) organization that supports the Processing software. Much of the core code for Processing 2.0 and 3.0 has come from the sharp minds of Andrés Colubri and Manindra Moharana. Scott Murray, Jamie Kosoy, and Jon Gacnik have built a wonderful web infrastructure for the project. James Grady is rocking the 3.0 user interface. We thank Florian Jenett for his years of diverse work on the project, including the forums, website, and design. Elie Zananiri and Andreas Schlegel have created the infrastructure for building and documenting contributed libraries, and have spent countless hours curating the lists. Many others have contributed significantly to the project; the precise data is available at https://github.com/processing.

This book grew out of teaching with Processing at UCLA. Chandler McWilliams has been instrumental in defining these classes. Casey thanks the undergraduate students in the Department of Design Media Arts at UCLA for their energy and enthusiasm. His teaching assistants have been great collaborators in defining how Processing is taught. Hats off to Tatsuya Saito, John Houck, Tyler Adams, Aaron Siegel, Casey Alt, Andrés Colubri, Michael Kontopoulos, David Elliot, Christo Allegra, Pete Hawkes, and Lauren McCarthy.

Jonathan Feinberg began developing Processing.py independently in 2010. Google provided initial support for the development of Python Mode for the Processing IDE in April 2014. The Processing Foundation and Fathom provided additional logistical support. James Gilles made important contributions to the development of Python Mode as well. Work on the Reference, examples, and tutorials was funded in the summer of 2014 in part by the Integrative Design, Arts, and Technology (IDeATe) initiative at Carnegie Mellon University, and by a grant from the National Endowment for the Arts managed by the Frank-Ratchye STUDIO for Creative Inquiry at CMU. Thank you to Miles Peyton for his work on the documentation and to Golan Levin for guidance and support. We also thank Luca Damasco, who helped bring Processing.py into alignment with the newly released Processing 3 during the 2015 Google Summer of Code, again under guidance from Golan Levin and the Frank-Ratchye STUDIO for Creative Inquiry at CMU.

The Processing.py project is currently maintained by Jonathan Feinberg and a small team of contributors. You can learn more about Processing.py at the project’s website.

Through founding the Aesthetics and Computation Group (1996–2002) at the MIT Media Lab, John Maeda made all of this possible.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.158.165