← Back

ofxPython

github.com/chaosct/ofxPython · @chaosct
OF 0.12 Archived Bridges

openFrameworks addon to embed Python

65 13 Last commit 7mo ago Created 11y ago

Branches ahead of master

These branches have commits not yet on master — could be unmerged fixes or work in progress worth a look.

OF0.9.8 27 commits ahead · last commit 9y ago
OF0.9.0 15 commits ahead · last commit 10y ago

README

ofxPython



This Addon is not maintained, and it is abandoned

(c) 2015 Carles F. Julià <carles@protopixel.net>

Introduction

May be you are like me and love Python and openFrameworks, or maybe you just need to embed a scripting engine and dislike Lua. Lua is nice but Python comes full of batteries.

This addon allows you to embed a Python interpreter into an openFrameworks application, and offers Python bindings to many OF functions, so you can draw from Python code.

This addon uses the common swig bindings for OF.

License

See license.md. Spoiler alert: it's MIT

Installation

Drop the folder into the OF/addons/ folder. If your project generator is clever enough it will copy the OF/addons/ofxPython/lib/*.py files into the data/ folder, copy it manually otherwise.

You will need Python (2.7 tested) installed in order to compile your program.

Compatibility

It is now compiling both in Linux64, Windows (Code::Blocks and Visual Studio) and OSX. Generated for OF 0.8.4

Linux:###

Make sure the python-dev package is installed:

$ apt-get install python-dev


Windows/Visual Studio###

The Visual Studio projects assume Python 2.7 is installed in C:\Python27. If you have installed python in a different location, you can set an environment variable named PYTHON with the correct path.

Re-generating the bindings

Install SWIG and run:

$ ./generatebindings.sh


Known issues

Contributing

Please do! Open issues, send pull requests etc.

Get this addon

HTTPS
SSH