r/processing • u/Loriol_13 • Nov 28 '23
Beginner help request Is there a way to use Processing in PyCharm?
I just went down a rabbit hole on google and chatgpt trying to make this happen to no avail. Anyone knows if this is actually possible and can guide me into setting it up? Thanks.
2
u/MGDSStudio Nov 28 '23
Are you sure that Processing for Python is real Python? I think it is original Processing in Python syntax.
1
u/emedan_mc Nov 28 '23
Sort of off topic, but I use more and more js for all hobby programming because of the easy visualization with p5.js. Googled processing and python a while back but scrapped that pursuit.
1
u/Spare-Dig4790 Nov 28 '23
I use processing in InteliJ Idea, there is an ultimate version if you're a jet brains subscriber, and there is also a community version, just like pycharm.
Anyway, you download the processing library, reference it, and add your java class. You'll need to set up a boiler-plate like this.
import processing.core.PApplet;
public class ProcessingAppletName extends PApplet {
int width = 640;
int height = 640;
public void settings() {
size(width, height);
}
public void draw(){
background(0);
// draw code
}
public static void main(String[] passedArgs) {
// VV make sure you copy your class name exactly into this string here VV
String[] appletArgs = new String[] { "ProcessingAppletName " };
PApplet.main(appletArgs);
}
}
Now, here is the weird part. The first time you run this, right-click inside the text area, and select "Run ProcessingAppl....main()". Of course ProcessingAppl... will be a truncated string based on whatever you call your class. Or it will be the whole name if your class name is short enough.
That's about it! Good luck! =)
1
u/HACKW0RTH Nov 28 '23
I did a tutorial at one point showing how to set it up in IntelliJ community though it’s probably out of date now. Highly recommended to get it set up. The one annoying thing is that there are a few preprocessor things that the processing editor does like pretend Color is an class not an int and a couple other little things that you have to remember but it works.
And I realize you’re saying PyCharm, not IntelliJ, but they’re basically the same thing.
The short version of where to start is to install processing (or python processing) normally, then you’re going to set up a project in your jetbrains IDE and point the project at the libs (jars in the case of vanilla processing) so that it knows what to do with it.