doni
June 7, 2023, 4:01am
1
hi forum. is it possible to call python script from processing sketch. thank you
You could use launch() :
Or directly manipulate Java’s Process class as on this example sketch link :
/**
* ##library.name##
* ##library.sentence##
* ##library.url##
*
* Copyright ##copyright## ##author##
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
This file has been truncated. show original
1 Like
hx2A
June 12, 2023, 7:46pm
4
This won’t work if you use the Processing PDE, but you can use py5 to make arbitrary calls from Processing to Python.
https://py5coding.org/content/processing_mode.html
py5’s Processing mode adds a callPython()
method to Processing. You can pass Java objects to Python and the Python code can return Python objects back to Java.
The example code in this folder will help you:
1 Like