Git Product home page Git Product logo

processingpy_import_examples's Introduction

Processing.py import examples

This is a collection of example sketches demonstrating how Processing.py sketches can import and use pure-python modules and packages -- whether built-in (like unittest), simple modules like pyparsing or complex third-party packages like jinja2.

Processing.py is Python Mode for Processing. It can be used to quickly wrap Python code together with the Processing Java API and distribute them as cross-platform sketches that run either as standalone apps or within the Processing IDE (PDE). Processing.py supports Python 2.7 running on the Jython 2.7 Python-on-Java interpreter.

Getting Started

Clone or download the collection, or clone or download any sketch in the collection. Then open any .pyde file using the Processing development envrionment (PDE) application.

Prerequisites

If not already installed, you must:

  1. Download Processing 3.x
  2. In Processing, install Python Mode:
    • Processing > Tools > Add Tool > Modes > Python Mode

Using example sketches

  1. Download or clone the sketch repository.
  2. Launch the example in Processing by double-clicking the .pyde file.
  3. Modify the sketch.

Adding pure-python modules / packages

Sketches come with the necessary modules (.py) or packages (directories of .py files) already included. To use them in a new sketch, either copy them into a new sketch or install them locally for all sketches.

Copy into a new sketch

  1. In Processing, create and save a new Python Mode sketch.
  2. In the file browser, open the example sketch
  3. Copy any modules (.py) or packages (directories of .py files) from the example sketch into the new sketch directory, next to the new .pyde file.

The new sketch can now use import mymodule to access the module.

Install locally

  1. In the file browser, open the example sketch
  2. Copy any modules (.py) or packages (directories of .py files) from the example sketch into the directory Processing > libraries > site-packages
  3. In Processing, create a new Python Mode sketch.

The new sketch can now use import mymodule to access the module even without a local copy in its directory.

Creating new sketches

The blank sketch template offers a new blank Processing.py sketch under version control. Clone / fork / download it -- or use the new_processingpy_sketch.sh shell script to quickly create a new blank Processing.py sketch under git version control with a unique name. Usage from the command line:

new_processingpy_sketch.sh MySketchFolderName

This will create a new git repo MySketchFolderName and populate it with a sketch template MySketchFolderName.pyde.


Versioning

This project uses semantic versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the Unlicense - see the LICENSE file for details.

Authors

processingpy_import_examples's People

Contributors

jeremydouglass avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.