py.Processing with PyCharm?

Hi.
I am using the Python mode, but would like MORE.
Being a Pyhon developer I would like to use PyCharm as my IDE of choice (and possibly execute the code from there).
Is this possible?

Welcome, nemecsek69!

Processing.py runs on Jython – a Java implementation of Python. So, this would require a custom PyCharm run/debug configuration and the command-line version of Processing.py.

This is how I managed to get it working:

  1. Download the command line version of Processing.py for your platform: https://py.processing.org/tutorials/command-line

  2. Extract the contents wherever you wish (this could even be your working project directory)

  3. In PyCharm, create a new project (a new environment or existing Python interpreter will work fine) and select Run > Edit Configurations

  4. Click the + to create a new configuration; leave the Script path field empty (just ignore the warning); in the Parameters field enter:
    -c "import os; os.system('path_to\processing-py.bat script_name.pyde')"

The processing-py.bat is the location of the .bat file in your extracted download location. For Linux/Mac, this would be an .sh or .app file.
The script_name.pyde is the filename of the Processing script you’re writing.

You can now run scripts using Run > Run your_config_name.

For error and console output, look for the .err.txt and .out.txt files alongside your .pyde file. I usually monitor these using a separate terminal window(s), using a tail -f command.

4 Likes

Thank you, @tabreturn. Your solution is very straightforward, I didn’t think about it.
At the moment nothing works, I saw only now that I need JRE 8u202 :frowning:
But I am positive.

1 Like

You may also be interested in p5py – it is limited and in early development compared to Python mode, but runs native python3.

1 Like