Live Coding with Python and openFrameworks

Hi all,

Recently I added my 50 cents to the bindings section with the of-Python binding for OS X (see post http://forum.openframeworks.cc/t/python-bindings-for-openframeworks/348/28">python bindings for openframeworks]http://forum.openframeworks.cc/t/python-bindings-for-openframeworks/348/28.

It’s not magic stuff, but maybe someone likes to play around with it. I appreciate your opinions!

Toby

This is really cool! Super cool!

Wow - that is really awesome.
I see that the OF classes are also available - if I made a setup.py and used the same code to read it in as the way draw.py is read in - how would I go about making an ofVideoGrabber object for example?

thanks so much!
theo

[quote author=“theo”]Wow - that is really awesome.
I see that the OF classes are also available - if I made a setup.py and used the same code to read it in as the way draw.py is read in - how would I go about making an ofVideoGrabber object for example?

thanks so much!
theo[/quote]

Why would you want to change the vidGrabber initialization code at runtime? You can just put it right into the parent py-file (in the example this is animation.py). But of course you can do this for the setup routine as well. Just create a setup.py, add the video grabber code and read / execute it inside the def setup(self): function. The code in the python file loaded at runtime runs in the scope of the function that calls exec(). So it is no problem to create an ofVideoGrabber instance and then initialize it in a different file…

Hope I got your question right?

Oh no - actually it was a bit more a python newbie question :slight_smile:
Just how to instantiate a new ofVideoGrabber object in the python code.

like for C++ it would be

  
ofVideoGrabber myGrabber;  
or   
ofVideoGrabber * myGrabber = new ofVideoGrabber();  

hmm looks like it is

  
video = ofVideoGrabber();  
video.setVerbose(true);  

seems to work fine - though the ichat camera is not opening - might be a 0.04 bug/issue.

cool - any chance you will be updating your live coding wrapper for 005 and future releases? I think this could be really great for students for quickly understanding how changing parameters can affect an animation.

thanks again!
theo

Oh, I’m sorry I got you wrong. Maybe I should write up something like a newbie tutorial on Python with openframeworks. Of course I will provide updates of the binding. I will announce them on the forum. Thanks!

Hey,

I have posted an updated version of the OSX-based of-python binding on my website. The new binding is based on 005 and comes with a more sophisticated Xcode project. Should build out of the box on Leopard:

http://blog.tlensing.org/2008/12/17/ope-…–os-x-105/

Regards
Toby

I’d really like to use openFrameworks as a livecoding environment. I only run linux though. Any ideas about how i could get your bindings to work in linux?