Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch sketch from command line? #120

Open
schuelaw opened this issue Dec 10, 2014 · 16 comments

Comments

@schuelaw
Copy link

commented Dec 10, 2014

With a regular processing sketch, one can launch from the command line using something like:

processing-java --sketch=Conway --output=/tmp/Conway --run

This doesn't work when the sketch was created in python mode. Is there a workaround?

@diogotito

This comment has been minimized.

Copy link

commented Jul 1, 2015

If I'm not wrong, what you are looking for is this:
https://github.com/jdf/processing.py#processingpy

@tildebyte

This comment has been minimized.

Copy link

commented Jul 2, 2015

The precise link. Note that on Windows, it would be e.g.

processing-py.bat foo.pyde

although I use the following (rather brittle) .cmd file:

javaw -Xmx1024m -jar "%~dp0\processing-py.jar" "%~1"

as processing-py.cmd foo.pyde

@jsundram

This comment has been minimized.

Copy link

commented Mar 28, 2016

I'm not sure if this has changed since the release of Processing v3 with Python Mode, but I'm not sure where to get processing-py.jar; it's nowhere to be found in the ./modes/PythonMode/ folder found in my processing_sketchbook folder.

Once Python mode is installed, what's the recommended way to run my .pyde file from from the command line? (I've confirmed that processing-java still doesn't work...)

@jdf jdf self-assigned this Apr 3, 2016
@b-jufre

This comment has been minimized.

Copy link

commented May 4, 2016

@jsundram Have you found a solution? I'm stuck with this same problem when trying to build my sketch from Sublime Text with a build system... :'(

@schuelaw

This comment has been minimized.

Copy link
Author

commented May 4, 2016

Have you tried tildebyte's suggestion above? I never did. Like you, I would love to break away from the processing editor and, in my case, use vim to edit and run sketches. Whenever I'm forced to use a text editor other than vim, I feel like an amputee. After using vim for 24 years, it is like an extension of my body. :)

@tildebyte

This comment has been minimized.

Copy link

commented May 4, 2016

Some things have changed in P5/P5Py 3+, among them, the standalone hasn't really been tested, so you're in virgin territory ;)

@schuelaw

This comment has been minimized.

Copy link
Author

commented May 4, 2016

Yeah, I just poked around in the python mode directory and there are now several jar files. No idea how to slap them together to do a command-line run.

@eraserpeel

This comment has been minimized.

Copy link

commented Jun 18, 2016

@Bob131

This comment has been minimized.

Copy link

commented Nov 21, 2016

Anyone who's after a quick fix can apply the attached patch in their Processing directory
patch.txt

@atoav

This comment has been minimized.

Copy link

commented Mar 20, 2018

Is there a way to run python mode from CLI yet?

@jsundram

This comment has been minimized.

Copy link

commented Mar 21, 2018

@atoav -- I got this to work:

  1. Read http://py.processing.org/tutorials/command-line/
  2. Download the standalone Processing.py for MacOSX here
  3. Copy processing-py.jar to your sketch directory (you may also need to copy processing-py-natives-macosx-universal.jar to this directory)
  4. Run your sketch from the sketch directory: java -jar processing-py.jar sketch.py
@v715

This comment has been minimized.

Copy link

commented Jun 28, 2018

I have followed all the steps outlined in http://py.processing.org/tutorials/command-line/, however, I keep getting the following error message:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.python.core.PySystemState (file:/Users/vivek/Documents/GitHub/Coding-PyTrain/Keys/processing-py.jar) to method java.io.Console.encoding()
WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.NoClassDefFoundError: com/apple/eawt/QuitHandler
@etsuko-io

This comment has been minimized.

Copy link

commented Nov 5, 2018

@v715 I have exactly the same issue. I think you can ignore the warnings, the main problem is that the application just won't start up. A Java applet briefly appears in the dock but then instantly disappears. That's when the QuitHandler error prints in my case.

@auraz

This comment has been minimized.

Copy link

commented Feb 1, 2019

Same for me

@juaneduardoflores

This comment has been minimized.

Copy link

commented May 12, 2019

Is there a solution to this problem? It works on my PC, but when I try to do this on Mac OS Mojave 10.14.4 I get the same warnings mentioned above along with this message:
java.lang.NoClassDefFoundError: com/apple/eawt/QuitHandler

@davidspry

This comment has been minimized.

Copy link

commented Jul 3, 2019

I've just encountered this problem while trying to launch a sketch from CodeRunner.

processing-py.jar and processing-py-natives-macosx-universal.jar are in the sketch directory, and the run command is: java -jar processing-py.jar $filename

As in v715's post above, the error message is:
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.python.core.PySystemState (PATH/TO/processing-py.jar) to method java.io.Console.encoding() WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release java.lang.NoClassDefFoundError: com/apple/eawt/QuitHandler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.