The command line feature that allows one to use Processing Python mode outside the Processing IDE is not currently maintained, unfortunately. I always had a hard time making it work. There was some discussion on using it with Atom: How to run Processing Python Mode in Atom? - #3 by BeastCoder and maybe VS Code but I couldn’t find them right now.
I’m unfamiliar with the kind of instantiation you are doing. For simple sketches
one should be able to just use the global name frameCount
, I believe.
Another idea, if you want to integrate with modern Python libraries, would be to use a completely external Python 3 environment using py5 (Python 3 + Java with JPype) or p5py (Python 3, no Java) instead.