Processing’s Python Mode is based on Jython: 
For an actual Python-based solution, you may try the Processing flavor p5py instead: 
However, I’d say it’s pretty much in an alpha state yet. 
Processing’s Python Mode is based on Jython: 
For an actual Python-based solution, you may try the Processing flavor p5py instead: 
However, I’d say it’s pretty much in an alpha state yet. 