[TUTORIAL]Running Python Mode in VScode

This is the method that I used to get processing.py sketches to run in VScode.

You will need:

  • Java to be installed and added to path
  • The file processing-py.jar
  • The Code runner extension

To get the first two items refer to the tutorial on how to run processing.py sketches on the command line here.

  1. Open up a new workspace and create a python file with the processing code you want to run.
    Example code:
# mouse_follow.py
def setup():

def draw():
    ellipse(mouseX, mouseY, 50, 50)
  1. Add the processing-py.jar file in the same workspace.
  2. In the settings.json file under WORKSPACE SETTINGS tab, add the line:
 "code-runner.customCommand": "java -jar processing-py.jar mouse_follow.py"

So it should look something like this:

    "code-runner.customCommand": "java -jar processing-py.jar mouse_follow.py"
  1. Run the command Run Custom Command (Ctrl + Alt + K)
  2. Bask in the glory of your work.

NB: The file processing-py.jar can be located anywhere just add its path to the custom command.

Let me know if you get stuck on any part of this, I will try to help you.
No, Thankyou!


Thank you so much for creating this!

1 Like

very nice! I’m doing a presentation about creative coding with Python and this will be very useful, thanks for sharing!


I was wondering if anyone starting Processing from VS Code or from the command line know how to control the location of the Processing application? I’m running in two screens, and I’d like to set where the sketch will show up on the screen after launch.

I have not tested it (because I don’t have a second monitor right now), but see if fullscreen() would help:


fullScreen(renderer, display)

Known issues: https://github.com/jdf/processing.py/issues/346

1 Like

hi I got an error as this:

[Running] java -jar processing-py.jar mouse_follow.py

‘java’ is not recognized as an internal or external command,

operable program or batch file.

and i have no idea what to do, would you help me?

Have you added the Java path to your system variables?

I’ve mentioned this thread on an issue: https://github.com/TobiahZ/processing-vscode/issues/79
So I’m linking it in case someone back here has the skills to contribute to the VS Code extension…

1 Like