Find absolute path of the libraries folder from within a library?

I’m currenty writing a library for using Quantum annealers with processing.
However run programs on these I need my library to run python scripts and for that I first need my library to be able to find them.
Is there an easy way of finding the library folder?


Some hints in this link

Hi @NumericPrime
If you can include the Python scripts with your sketch you can try using:

setup() {
 String path = this.dataPath("");
   //format this for your OS, / for Unix, \\ for Win
   path = path + "\\";

You will need to put the scripts in a folder called ‘data’ in your root sketch folder. I find this to be the easiest method of finding resources necessary for the sketch. Java’s getPath() and getAbsolutePath() usually will return the path of the Processing.exe application.

1 Like


final String path = dataPath("");